107 lines
2.4 KiB
YAML
Executable File
107 lines
2.4 KiB
YAML
Executable File
version: '3.8'
|
|
|
|
services:
|
|
fsm_server:
|
|
build:
|
|
context: ../../
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8000:8000"
|
|
container_name: fsm_server
|
|
restart: always
|
|
depends_on:
|
|
- fsm_mysql
|
|
- fsm_redis
|
|
volumes:
|
|
- fsm_static:/www/fsm_server/backend/static
|
|
environment:
|
|
- SERVER_HOST=0.0.0.0
|
|
- SERVER_PORT=8000
|
|
- DATABASE_HOST=fsm_mysql
|
|
- DATABASE_PORT=3306
|
|
- DATABASE_USER=root
|
|
- DATABASE_PASSWORD=123456
|
|
- DATABASE_DB_NAME=fsm
|
|
- REDIS_HOST=fsm_redis
|
|
- REDIS_PORT=6379
|
|
- REDIS_PASSWORD=
|
|
- REDIS_DATABASE=0
|
|
networks:
|
|
- fsm_network
|
|
command: |
|
|
sh -c "
|
|
wait-for-it -s fsm_mysql:3306 -s fsm_redis:6379 -t 300
|
|
supervisord -c /etc/supervisor/supervisord.conf
|
|
supervisorctl restart
|
|
"
|
|
|
|
fsm_mysql:
|
|
image: mysql:8.0.29
|
|
ports:
|
|
- "3306:3306"
|
|
container_name: fsm_mysql
|
|
restart: always
|
|
environment:
|
|
MYSQL_DATABASE: fsm
|
|
MYSQL_ROOT_PASSWORD: 123456
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- fsm_mysql:/var/lib/mysql
|
|
networks:
|
|
- fsm_network
|
|
command:
|
|
--default-authentication-plugin=mysql_native_password
|
|
--character-set-server=utf8mb4
|
|
--collation-server=utf8mb4_general_ci
|
|
--lower_case_table_names=1
|
|
|
|
fsm_redis:
|
|
image: redis:7.0.4
|
|
ports:
|
|
- "6379:6379"
|
|
container_name: fsm_redis
|
|
restart: always
|
|
volumes:
|
|
- fsm_redis:/data
|
|
networks:
|
|
- fsm_network
|
|
command: |
|
|
--requirepass ""
|
|
--appendonly yes
|
|
--appendfilename "redis-staging.aof"
|
|
--appendfsync everysec
|
|
--dir /data
|
|
--databases 16
|
|
--maxmemory 256mb
|
|
--maxmemory-policy allkeys-lru
|
|
|
|
fsm_nginx:
|
|
image: nginx:stable
|
|
ports:
|
|
- "8000:80"
|
|
container_name: fsm_nginx
|
|
restart: always
|
|
depends_on:
|
|
- fsm_server
|
|
volumes:
|
|
- ../nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- fsm_static:/www/fsm_server/backend/static
|
|
networks:
|
|
- fsm_network
|
|
|
|
networks:
|
|
fsm_network:
|
|
name: fsm_network
|
|
driver: bridge
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 172.10.10.0/24
|
|
|
|
volumes:
|
|
fsm_mysql:
|
|
name: fsm_mysql
|
|
fsm_redis:
|
|
name: fsm_redis
|
|
fsm_static:
|
|
name: fsm_static |