Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (74 loc) · 1.97 KB
/
Copy pathdocker-compose.yml
File metadata and controls
79 lines (74 loc) · 1.97 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
services:
db:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-freemed}
MYSQL_DATABASE: freemed
MYSQL_USER: freemed
MYSQL_PASSWORD: freemed
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./internal/db/migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 20
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
backend:
build: .
restart: unless-stopped
ports:
- "3000:3000"
environment:
FREEMED_DB_HOST: db:3306
FREEMED_DB_USER: freemed
FREEMED_DB_PASS: freemed
FREEMED_DB_NAME: freemed
FREEMED_REDIS_HOST: redis:6379
# Required: the server will not start with a weak/default signing key
# (>= 32 bytes, not the built-in default). Generate with:
# openssl rand -base64 48
# Put it in a .env file next to this compose file (see .env.example).
FREEMED_SESSION_KEY: ${FREEMED_SESSION_KEY:?FREEMED_SESSION_KEY must be set to a strong random value, e.g. openssl rand -base64 48}
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
frontend:
build: ./frontend
restart: unless-stopped
ports:
- "80:80"
depends_on:
backend:
condition: service_healthy
portal:
build: ./frontend-portal
restart: unless-stopped
ports:
- "8080:80"
depends_on:
backend:
condition: service_healthy
volumes:
mysql_data: