2021-03-07 02:42:17 +00:00
|
|
|
|
version: "3"
|
|
|
|
|
services:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
dvadmin-web:
|
|
|
|
|
container_name: dvadmin-web
|
2021-04-18 09:53:24 +00:00
|
|
|
|
ports:
|
|
|
|
|
- "8080:8080"
|
2021-03-08 16:41:48 +00:00
|
|
|
|
build:
|
|
|
|
|
context: ./
|
2022-04-05 05:25:15 +00:00
|
|
|
|
dockerfile: ./docker_env/web/Dockerfile
|
2021-03-08 16:41:48 +00:00
|
|
|
|
environment:
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
volumes:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
- ./docker_env/nginx/my.conf:/etc/nginx/conf.d/my.conf
|
2021-03-07 02:42:17 +00:00
|
|
|
|
expose:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
- "8080"
|
2021-03-07 02:42:17 +00:00
|
|
|
|
networks:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
network:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
ipv4_address: 177.8.0.11
|
2021-03-07 02:42:17 +00:00
|
|
|
|
|
2022-05-02 10:15:59 +00:00
|
|
|
|
dvadmin-django:
|
2021-03-07 02:42:17 +00:00
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: ./docker_env/django/Dockerfile
|
2022-05-02 10:15:59 +00:00
|
|
|
|
container_name: dvadmin-django
|
2022-04-05 05:25:15 +00:00
|
|
|
|
working_dir: /backend
|
|
|
|
|
# 打开mysql 时,打开此选项
|
|
|
|
|
# depends_on:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# - dvadmin-mysql
|
2021-03-07 03:00:30 +00:00
|
|
|
|
environment:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
PYTHONUNBUFFERED: 1
|
2022-05-02 10:15:59 +00:00
|
|
|
|
DATABASE_HOST: dvadmin-mysql
|
2022-04-05 05:25:15 +00:00
|
|
|
|
TZ: Asia/Shanghai
|
2021-03-07 02:42:17 +00:00
|
|
|
|
volumes:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
- ./backend:/backend
|
2021-03-07 02:42:17 +00:00
|
|
|
|
- ./logs/log:/var/log
|
|
|
|
|
ports:
|
|
|
|
|
- "8000:8000"
|
|
|
|
|
expose:
|
|
|
|
|
- "8000"
|
|
|
|
|
restart: always
|
|
|
|
|
networks:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
network:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
ipv4_address: 177.8.0.12
|
2021-03-07 02:42:17 +00:00
|
|
|
|
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# dvadmin-mysql:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
# image: mysql:5.7
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# container_name: dvadmin-mysql
|
2022-04-05 05:25:15 +00:00
|
|
|
|
# #使用该参数,container内的root拥有真正的root权限,否则,container内的root只是外部的一个普通用户权限
|
|
|
|
|
# #设置为true,不然数据卷可能挂载不了,启动不起
|
|
|
|
|
## privileged: true
|
|
|
|
|
# restart: always
|
|
|
|
|
# ports:
|
|
|
|
|
# - "3306:3306"
|
|
|
|
|
# environment:
|
|
|
|
|
# MYSQL_ROOT_PASSWORD: "123456"
|
|
|
|
|
# MYSQL_DATABASE: "dvadmin_pro"
|
|
|
|
|
# TZ: Asia/Shanghai
|
|
|
|
|
# command:
|
|
|
|
|
# --wait_timeout=31536000
|
|
|
|
|
# --interactive_timeout=31536000
|
|
|
|
|
# --max_connections=1000
|
|
|
|
|
# --default-authentication-plugin=mysql_native_password
|
|
|
|
|
# volumes:
|
|
|
|
|
# - "./docker_env/mysql/data:/var/lib/mysql"
|
|
|
|
|
# - "./docker_env/mysql/conf.d:/etc/mysql/conf.d"
|
|
|
|
|
# - "./docker_env/mysql/logs:/logs"
|
|
|
|
|
# networks:
|
|
|
|
|
# network:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# ipv4_address: 177.8.0.13
|
2021-03-07 02:42:17 +00:00
|
|
|
|
|
2022-04-05 05:25:15 +00:00
|
|
|
|
|
|
|
|
|
# 如果使用celery 插件,请自行打开此注释
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# dvadmin-celery:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
# build:
|
|
|
|
|
# context: .
|
|
|
|
|
# dockerfile: ./docker_env/celery/Dockerfile
|
|
|
|
|
# # image: django:2.2
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# container_name: dvadmin-celery
|
2022-04-05 05:25:15 +00:00
|
|
|
|
# working_dir: /backend
|
|
|
|
|
# depends_on:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# - dvadmin-mysql
|
2022-04-05 05:25:15 +00:00
|
|
|
|
# environment:
|
|
|
|
|
# PYTHONUNBUFFERED: 1
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# DATABASE_HOST: dvadmin-mysql
|
2022-04-05 05:25:15 +00:00
|
|
|
|
# TZ: Asia/Shanghai
|
|
|
|
|
# volumes:
|
|
|
|
|
# - ./backend:/backend
|
|
|
|
|
# - ./logs/log:/var/log
|
|
|
|
|
# restart: always
|
|
|
|
|
# networks:
|
|
|
|
|
# network:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
# ipv4_address: 177.8.0.14
|
2021-03-28 18:33:02 +00:00
|
|
|
|
|
|
|
|
|
networks:
|
2022-04-05 05:25:15 +00:00
|
|
|
|
network:
|
|
|
|
|
ipam:
|
|
|
|
|
driver: default
|
|
|
|
|
config:
|
2022-05-02 10:15:59 +00:00
|
|
|
|
- subnet: '177.8.0.0/16'
|
2022-04-05 05:25:15 +00:00
|
|
|
|
|