-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (76 loc) · 2.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (76 loc) · 2.13 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
services:
db:
image: postgres:15-alpine
container_name: ratelock_db
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ratelock
volumes:
- ratelock_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d ratelock" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
redis:
image: redis:7-alpine
container_name: ratelock_redis
# Not published to the host — the backend reaches it over the compose
# network as `redis:6379`. (Avoids clashing with a Redis already running
# on the host's 6379.) Add `ports: ["6380:6379"]` if you want host access.
expose:
- "6379"
command: redis-server --requirepass ${REDIS_PASSWORD:-thisistheredislocalpassword} --bind 0.0.0.0
volumes:
- ratelock_redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-thisistheredislocalpassword}", "ping" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
backend:
build:
context: ./backend
container_name: ratelock_backend
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: production
PORT: "4000"
DATABASE_URL: postgresql://postgres:postgres@db:5432/ratelock
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD:-thisistheredislocalpassword}
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:8080}
ports:
- "4000:4000"
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:4000/health" ]
interval: 15s
timeout: 5s
retries: 5
start_period: 40s
web:
build:
context: .
dockerfile: Dockerfile.web
container_name: ratelock_web
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
ports:
- "8080:80"
volumes:
ratelock_data:
ratelock_redis_data: