-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (80 loc) · 1.84 KB
/
docker-compose.yml
File metadata and controls
85 lines (80 loc) · 1.84 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
services:
postgres:
image: postgres:16-alpine
container_name: auth_postgres
environment:
POSTGRES_DB: authdb
POSTGRES_USER: authuser
POSTGRES_PASSWORD: authpass
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres-init:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U authuser -d authdb"]
interval: 5s
timeout: 5s
retries: 5
networks:
- auth_network
fastify-api:
build:
context: ./fastify-api
target: final
dockerfile: Dockerfile
container_name: fastify_api
environment:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://authuser:authpass@postgres:5432/authdb
PRIVATE_KEY_PATH: /app/keys/private.pem
PUBLIC_KEY_PATH: /app/keys/public.pem
ACCESS_TOKEN_EXPIRY: 15m
REFRESH_TOKEN_EXPIRY: 7d
volumes:
- ./keys:/app/keys:ro
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
networks:
- auth_network
restart: unless-stopped
uws-server:
build:
context: ./uws-server
target: final
dockerfile: Dockerfile
container_name: uws_server
environment:
NODE_ENV: production
PORT: 3001
PUBLIC_KEY_PATH: /app/keys/public.pem
ACCESS_TOKEN_MAX_AGE: 900
volumes:
- ./keys:/app/keys:ro
ports:
- "3001:3001"
networks:
- auth_network
restart: unless-stopped
nginx:
image: nginx:alpine
container_name: auth_nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "80:80"
depends_on:
- fastify-api
- uws-server
networks:
- auth_network
restart: unless-stopped
volumes:
postgres_data:
networks:
auth_network:
driver: bridge