docker-compose 多项目部署
Dockerfile
FROM nginx
LABEL company=com.ligy
LABEL by=ligenyun
COPY dist/ /usr/share/nginx/html/
docker-compose.yml
version: '3'
services:
ui2:
container_name: ui2
restart: always
build: ./ui2
ports:
- "8002:80"
ui3:
container_name: ui3
restart: always
build: ./ui3
ports:
- "8003:80"
Dockerfile
docker build -t mynginx:v1 .
docker run -itd --name="myningx" -p 8001:80 mynginx:v1
curl 192.168.0.160:8002/1.txt
curl 192.168.0.160:8003/1.txt
docker-compose build
docker-compose up -d
docker-compose up -d --build
天生我材必有用,千金散尽还复来