-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.api.yml
69 lines (65 loc) · 1.65 KB
/
docker-compose.api.yml
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
version: "3.8"
services:
cache:
image: redis:latest
ports:
- target: 6379
networks:
- backend
proxy:
image: nginx:latest
volumes:
- ./services/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- server
ports:
- target: 3000
published: 3000
mode: host
networks:
- backend
server:
image: pxseu/pxseu-dot-com_api:latest
build:
context: .
dockerfile: ./packages/api/Dockerfile
environment:
- REDIS_HOST=cache
- REDIS_PORT=6379
- ENV_PATH=/run/secrets/PXSEU_API_ENV_FILE
secrets:
- PXSEU_API_ENV_FILE
ports:
- target: 80
depends_on:
- cache
networks:
- backend
deploy:
replicas: 4
update_config:
parallelism: 2
order: start-first
failure_action: rollback
delay: 20s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
healthcheck:
test: curl --fail http://localhost/health || exit 1
interval: 10s
retries: 5
start_period: 5s
timeout: 10s
networks:
backend:
name: pxseu_api_swarm
driver: overlay
secrets: # top level secrets block
PXSEU_API_ENV_FILE:
external: true