Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (129 loc) · 3.9 KB
/
Copy pathdocker-compose.yml
File metadata and controls
135 lines (129 loc) · 3.9 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 20
restart: unless-stopped
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly:v2.0.0
command: ["--logtostderr", "--proactor_threads=4"]
ports:
- "${DRAGONFLY_PORT:-6379}:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -p 6379 ping | grep -q PONG"]
interval: 10s
timeout: 3s
retries: 10
restart: unless-stopped
backend:
image: ghcr.io/dvorinka/primora-backend:latest
build:
context: .
dockerfile: apps/backend/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
DRAGONFLY_URL: redis://dragonfly:6379/0
BACKEND_STORAGE_ROOT: /data/storage
BACKEND_MIGRATIONS_DIR: /app/db/migrations
VITE_APP_URL: ${VITE_APP_URL}
depends_on:
postgres:
condition: service_healthy
dragonfly:
condition: service_started
volumes:
- backend_storage:/data/storage
# Uncomment for FUNCTIONS_DRIVER=docker — sibling containers for
# sandboxed function runs. Socket access is root-equivalent on the
# host; leave commented unless you run untrusted function code.
# - /var/run/docker.sock:/var/run/docker.sock
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/api/v1/health/liveness || exit 1"]
interval: 15s
timeout: 5s
retries: 10
start_period: 20s
restart: unless-stopped
auth:
image: ghcr.io/dvorinka/primora-auth:latest
build:
context: .
dockerfile: apps/auth/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
DRAGONFLY_URL: redis://dragonfly:6379/0
BETTER_AUTH_URL: ${BETTER_AUTH_URL:-http://localhost/auth}
AUTH_BASE_URL: ${AUTH_BASE_URL:-http://localhost/auth}
VITE_APP_URL: ${VITE_APP_URL:-http://localhost}
depends_on:
postgres:
condition: service_healthy
dragonfly:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/health >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
start_period: 20s
restart: unless-stopped
frontend:
image: ghcr.io/dvorinka/primora-frontend:latest
build:
context: .
dockerfile: apps/frontend/Dockerfile
env_file:
- .env
environment:
VITE_APP_URL: http://localhost
VITE_AUTH_BASE_URL: http://localhost/auth
VITE_API_BASE_URL: http://localhost/api/v1
FRONTEND_PORT: 3000
depends_on:
backend:
condition: service_started
auth:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
restart: unless-stopped
nginx:
image: nginx:1.27-alpine
depends_on:
backend:
condition: service_started
auth:
condition: service_started
frontend:
condition: service_started
ports:
- "${NGINX_PORT}:80"
volumes:
- ./infra/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/nginx-health >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
restart: unless-stopped
volumes:
postgres_data:
backend_storage: