-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (101 loc) · 2.73 KB
/
docker-compose.yml
File metadata and controls
109 lines (101 loc) · 2.73 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
services:
codeguessr:
build: .
ports:
- "4335:4335"
depends_on:
db:
condition: service_healthy
restart: true
redis:
condition: service_healthy
environment:
# database
DB_URL: ${DB_URL}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DB_MAX_OPEN_CONNS: ${DB_MAX_OPEN_CONNS}
DB_MAX_IDLE_CONNS: ${DB_MAX_IDLE_CONNS}
DB_MAX_IDLE_TIME: ${DB_MAX_IDLE_TIME}
# AI
GEMINI_MODEL: ${GEMINI_MODEL}
GEMINI_API_KEY: ${GEMINI_API_KEY}
# cache
REDIS_ADDR: ${REDIS_ADDR}
REDIS_PW: ${REDIS_PW}
REDIS_DB: ${REDIS_DB}
REDIS_ENABLED: ${REDIS_ENABLED}
# mail
SMTP_GMAIL_HOST: ${SMTP_GMAIL_HOST}
SMTP_GMAIL_PORT: ${SMTP_GMAIL_PORT}
SMTP_GMAIL_USERNAME: ${SMTP_GMAIL_USERNAME}
SMTP_GMAIL_PASSWORD: ${SMTP_GMAIL_PASSWORD}
SMTP_TEST_HOST: ${SMTP_TEST_HOST}
SMTP_TEST_PORT: ${SMTP_TEST_PORT}
SMTP_TEST_USERNAME: ${SMTP_TEST_USERNAME}
SMTP_TEST_PASSWORD: ${SMTP_TEST_PASSWORD}
SMTP_SERVER_HOST: ${SMTP_SERVER_HOST}
SMTP_SERVER_PORT: ${SMTP_SERVER_PORT}
SMTP_SERVER_USERNAME: ${SMTP_SERVER_USERNAME}
SMTP_SERVER_PASSWORD: ${SMTP_SERVER_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:4335/api/v1/healthcheck || exit 1"]
interval: 1m
retries: 5
start_period: 10s
timeout: 10s
networks:
- CodeGuessr
db:
image: postgres:17.5-alpine3.22
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 10s
timeout: 10s
restart: always
ports:
- "5432:5432"
networks:
- CodeGuessr
redis:
image: redis:8.0.2-alpine
command: "redis-server --requirepass ${REDIS_PW}"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PW}", "ping"]
interval: 1s
timeout: 3s
retries: 5
start_period: 5s
restart: unless-stopped
networks:
- CodeGuessr
frontend:
build: ./frontend
ports:
- "3000:80"
depends_on:
codeguessr:
condition: service_healthy
networks:
- CodeGuessr
volumes:
postgres_data:
redis_data:
networks:
CodeGuessr:
driver: bridge