-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (71 loc) · 1.67 KB
/
docker-compose.yml
File metadata and controls
74 lines (71 loc) · 1.67 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
services:
db:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-glou}
POSTGRES_PASSWORD: ${DB_PASSWORD:-glou_secret}
POSTGRES_DB: ${DB_NAME:-glou_db}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-glou} -d ${DB_NAME:-glou_db}"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
ports:
- "5432:5432"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
api:
build:
context: ./api
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: ${NODE_ENV:-production}
DATABASE_URL: postgresql://${DB_USER:-glou}:${DB_PASSWORD:-glou_secret}@db:5432/${DB_NAME:-glou_db}
JWT_SECRET: ${JWT_SECRET}
PORT: 3001
PUID: ${PUID:-1000}
PGID: ${PGID:-1000}
ports:
- "3001:3001"
volumes:
- api_logs:/app/logs
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
web:
build:
context: ./web
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://api:3001}
restart: unless-stopped
depends_on:
- api
environment:
NODE_ENV: ${NODE_ENV:-production}
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://api:3001}
ports:
- "3000:3000"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
db_data:
driver: local
api_logs:
driver: local