mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
* Update the docker-compose deployment directory and internals * missed updates * update readme style
83 lines
1.7 KiB
YAML
83 lines
1.7 KiB
YAML
version: "3.10"
|
|
|
|
networks:
|
|
fba_network:
|
|
driver: bridge
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: 172.10.10.0/24
|
|
|
|
volumes:
|
|
fba_mysql:
|
|
fba_redis:
|
|
fba_static:
|
|
|
|
services:
|
|
fba_server:
|
|
build:
|
|
context: ../../
|
|
dockerfile: Dockerfile
|
|
container_name: "fba_server"
|
|
restart: always
|
|
depends_on:
|
|
- fba_mysql
|
|
- fba_redis
|
|
volumes:
|
|
- fba_static:/fba/backend/app/static
|
|
networks:
|
|
- fba_network
|
|
command:
|
|
- bash
|
|
- -c
|
|
- |
|
|
wait-for-it -s fba_mysql:3306 -s fba_redis:6379 -t 300
|
|
supervisord -c /fba/deploy/supervisor.conf
|
|
|
|
fba_mysql:
|
|
image: mysql:8.0.29
|
|
ports:
|
|
- "${DOCKER_DB_MAP_PORT:-3306}:3306"
|
|
container_name: "fba_mysql"
|
|
restart: always
|
|
environment:
|
|
MYSQL_DATABASE: fba
|
|
MYSQL_ROOT_PASSWORD: 123456
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- fba_mysql:/var/lib/mysql
|
|
networks:
|
|
- fba_network
|
|
command:
|
|
--default-authentication-plugin=mysql_native_password
|
|
--character-set-server=utf8mb4
|
|
--collation-server=utf8mb4_general_ci
|
|
--lower_case_table_names=1
|
|
|
|
fba_redis:
|
|
image: redis:6.2.7
|
|
ports:
|
|
- "${DOCKER_REDIS_MAP_PORT:-6379}:6379"
|
|
container_name: "fba_redis"
|
|
restart: always
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
volumes:
|
|
- fba_redis:/var/lib/redis
|
|
networks:
|
|
- fba_network
|
|
|
|
fba_nginx:
|
|
image: nginx
|
|
ports:
|
|
- "8000:80"
|
|
container_name: "fba_nginx"
|
|
restart: always
|
|
depends_on:
|
|
- fba_server
|
|
volumes:
|
|
- ../nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- fba_static:/www/fba/backend/app/static
|
|
networks:
|
|
- fba_network
|