wd-smebiz/docker-compose.yml

53 lines
1.1 KiB
YAML
Raw Normal View History

2023-08-02 10:18:36 +08:00
version: '3.8'
services:
wd-smebiz:
build:
context: .
dockerfile: Dockerfile
volumes:
# 挂载日报代码
- ../wd-smebiz:/home/wd-smebiz
# 挂载静态文件目类
- /home/file/wd-smebiz/static_data:/home/wd-smebiz/static_data
- /home/file/wd-smebiz/static/upload_files:/home/wd-smebiz/static/upload_files
ports:
2023-08-02 10:19:38 +08:00
- "8008:8008"
2023-08-02 10:18:36 +08:00
networks:
- app
command:
2023-08-02 18:46:58 +08:00
bash -c "cd /home/wd-smebiz && python3 main.py prod"
2023-08-02 10:18:36 +08:00
environment:
- TZ=Asia/Shanghai
2023-08-02 16:46:05 +08:00
depends_on:
- db
2023-08-03 17:08:20 +08:00
- redis
2023-08-02 16:46:05 +08:00
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: 12345
POSTGRES_USER: postgres
networks:
- app
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432" # Map PostgreSQL port 5432 to host port 5432
2023-08-03 17:08:20 +08:00
redis:
image: redis:latest
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis_data:/data
ports:
- "6379:6379"
networks:
- app
-
2023-08-02 10:18:36 +08:00
networks:
app:
2023-08-02 16:46:05 +08:00
external: true
volumes:
postgres_data: