This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
103 lines (96 loc) · 2.42 KB
/
compose.yml
File metadata and controls
103 lines (96 loc) · 2.42 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
services:
backend:
profiles: [prod]
build: ./backend
restart: unless-stopped
ports:
- "8080:8080"
environment:
PORT: ${PORT}
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
ACCESS_TOKEN_EXPIRATION: ${ACCESS_TOKEN_EXPIRATION}
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
REFRESH_TOKEN_EXPIRATION: ${REFRESH_TOKEN_EXPIRATION}
TOKEN_LIFETIME_REFRESH_THRESHOLD: ${TOKEN_LIFETIME_REFRESH_THRESHOLD}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
PGHOST: ${PGHOST}
PGPORT: ${PGPORT}
PGUSER: ${PGUSER}
PGPASSWORD: ${PGPASSWORD}
PGDATABASE: ${PGDATABASE}
REDIS_URL: ${REDIS_URL}
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget", "--spider", "-q", "http://localhost:3000/health"]
interval: 1s
timeout: 5s
retries: 5
networks:
- app-network
frontend:
profiles: [prod]
build: ./frontend
restart: unless-stopped
ports:
- "80:80"
networks:
- app-network
database:
profiles: [prod]
image: postgres:17-alpine
restart: unless-stopped
ports:
- "5432"
environment:
POSTGRES_USER: ${PGUSER}
POSTGRES_PASSWORD: ${PGPASSWORD}
POSTGRES_DB: ${PGDATABASE}
volumes:
- pgdata:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
- ./database/indices.sql:/docker-entrypoint-initdb.d/02-indices.sql:ro
- ./database/triggers.sql:/docker-entrypoint-initdb.d/03-triggers.sql:ro
- ./database/data.sql:/docker-entrypoint-initdb.d/04-data.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PGUSER} -d ${PGDATABASE}"]
interval: 1s
timeout: 5s
retries: 5
networks:
- app-network
database-dev:
extends: database
profiles: [dev]
ports:
- "5432:5432"
redis:
profiles: [prod]
image: redis:8-alpine
restart: unless-stopped
ports:
- "6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
networks:
- app-network
redis-dev:
extends: redis
profiles: [dev]
ports:
- "6379:6379"
volumes:
pgdata:
redisdata:
networks:
app-network:
driver: bridge