Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
docker-compose.yml 1.47 KB
Copy Edit Raw Blame History
cheng0867 authored 2019-10-29 16:32 . init
version: '3'
services:
# 前端(ready)
# nginx + vue
web:
# image: jsc_web
build: ./web
container_name: my-web
volumes:
# 挂载nginx全局配置
- $PWD/web/nginx/nginx.conf:/etc/nginx/nginx.conf
# 挂载nginx server配置
- $PWD/web/nginx/conf.d:/etc/nginx/conf.d
# 挂载nginx日志
- $PWD/web/nginx/logs:/var/log/nginx
- $PWD/web/static:/usr/share/nginx/html/static
- $PWD/web/media:/usr/share/nginx/html/media
# 挂载前端代码
- $PWD/web/code/dist:/usr/share/nginx/html
restart: always
ports:
# 容器80端口映射宿主机8080端口
- "8080:80"
- "8050:8050"
networks:
- front
- back
depends_on:
- djangoapp
# 后台(ready)
djangoapp:
# image: jsc_djangoapp
build: ./djangoapp
container_name: my-djangoapp
volumes:
# 挂载代码
- $PWD/djangoapp/code:/app
command: gunicorn --worker-class=\gevent cityplatjsc.wsgi:application -b 0.0.0.0:5001 -w 2 --reload
restart: always
ports:
- "5001:5001"
networks:
- front
- back
# 数据库(ready)
db:
image: mysql
container_name: my-db2
volumes:
# 挂载数据
- $PWD/db/data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "123456"
MYSQL_USER: 'root'
MYSQL_PASS: '123456'
restart: always
ports:
- "3306:3306"
networks:
- front
- back
networks:
front:
back:
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化