docker 软件安装
docker 安装
curl -sSL https://get.daocloud.io/docker | sh
docker-compose 安装
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.4.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
nginx 安装
docker-compose network手动指定成my_net
同网络之间的访问通过 “容器名”访问,例如nginx配置中:proxy_pass http://erp-web:80/,
version: '3.3'
services:
nginx:
image: nginx
restart: always
hostname: nginx
container_name: nginx
privileged: true
ports:
- 80:80
- 81:81
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf
- ./www/:/usr/share/nginx/html/
- ./logs/:/var/log/nginx/
networks:
default:
external:
name: my_net
my_net:
external: true