基于Docker的服务器部署

时间:2020-02-04 15:37:02

标签: image docker docker-compose

我已经在运行命令docker run -d --name blog --expose 80 --net nginx-proxy -e VIRTUAL_HOST=blog.DOMAIN.TLD wordpress时创建了基于docker的服务器端,它工作正常,只需要更改域名和容器名称即可,但是当我想使用docker-compose.yml文件时,可以基于laravel创建应用正在创建映射文件的容器,但未创建域 我的docker-compose.yml文件是

version'3'
services:
  mysql:
    container_name: mysql
    image: mysql:5.7
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql"]
      timeout: 10s
      retries: 5
    user: root
    ports:
      - 3306:3306
    volumes:
      - mysql-data:/var/lib/mysql
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
  visa:
    container_name: visa
    image: kalimeromk/apache:7.3
    restart: always
    expose:
       - 80
    environment:
       - VIRTUAL_HOST: blog.test
    volumes:
       - ./:/var/www/html
    depends_on:
      mysql:
        condition: service_healthy
# Global volumes
volumes:
  mysql-data:
networks:
  default:
    external:
      name: nginx-proxy

使用本教程:https://blog.ssdnodes.com/blog/host-multiple-websites-docker-nginx/

0 个答案:

没有答案