forked from yndx-yavshoke/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (64 loc) · 1.67 KB
/
Copy pathdocker-compose.yml
File metadata and controls
68 lines (64 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
version: '3.8'
services:
db:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-serverdb}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_INITDB_ARGS: "--data-checksums"
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-serverdb}"]
interval: 5s
timeout: 3s
retries: 12
start_period: 20s
networks:
- app-network
# Elysia Server
server:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:password@db:5432/serverdb}
JWT_SECRET: ${JWT_SECRET:-your-jwt-secret-key}
NODE_ENV: ${NODE_ENV:-production}
POSTGRES_DB: ${POSTGRES_DB:-serverdb}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
ports:
- "${SERVER_PORT:-3000}:3000"
volumes:
- ./experiments.json:/usr/src/app/experiments.json:ro
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
stdin_open: true
tty: true
networks:
- app-network
volumes:
postgres_data:
driver: local
networks:
app-network:
driver: bridge