-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (105 loc) · 2.77 KB
/
Copy pathdocker-compose.yml
File metadata and controls
114 lines (105 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASSWD}"
POSTGRES_DB: "${DB_NAME}"
volumes:
- postgres_volume:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U game_user -d game_db"]
interval: 5s
timeout: 5s
retries: 5
networks:
- 16night
redis:
image: redis:7-alpine
volumes:
- redis_volume:/data
networks:
- 16night
backend:
build: ./backend
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
volumes:
- ./backend:/app
environment:
- DATABASE_URL=postgresql+asyncpg://${DB_USER}:${DB_PASSWD}@db:5432/${DB_NAME}
- REDIS_URL=redis://redis:6379
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
networks:
- 16night
frontend:
build:
context: frontend
dockerfile: Dockerfile-compile
restart: always
depends_on:
- backend
networks:
- 16night
nginx:
image: nginx
ports:
- "6543:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/oauth2.conf:/etc/nginx/oauth2.conf
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./nginx/admin_list.map:/etc/nginx/maps/admin_list.map
restart: always
depends_on:
- frontend
- backend
- oauth2-proxy
- pgadmin
networks:
- 16night
oauth2-proxy:
build:
context: ./oauth2-proxy/build
dockerfile: Dockerfile
volumes:
- ./oauth2-proxy/oauth2_proxy.cfg:/etc/oauth2_proxy/oauth2_proxy.cfg
environment:
# These will be injected into the .cfg file placeholders
OAUTH2_PROXY_CLIENT_ID: "${client_id}"
OAUTH2_PROXY_CLIENT_SECRET: "${client_secret}"
OAUTH2_PROXY_COOKIE_SECRET: "${cookie_secret}"
command: --config=/etc/oauth2_proxy/oauth2_proxy.cfg --reverse-proxy --set-xauthrequest --session-store-type=redis --redis-connection-url=redis://redis:6379
networks:
- 16night
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION: "False"
networks:
- 16night
depends_on:
- backend
log-worker:
build:
context: ./log_worker
dockerfile: Dockerfile # 裡面只需簡單的 FROM python:3.10 \n RUN pip install redis psycopg2-binary \n CMD ["python", "worker.py"]
depends_on:
- backend
- db
- redis
networks:
- 16night
environment:
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWD}@db:5432/${DB_NAME}
networks:
16night:
driver: bridge
volumes:
postgres_volume:
redis_volume: