-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
142 lines (136 loc) · 3.6 KB
/
docker-compose.prod.yml
File metadata and controls
142 lines (136 loc) · 3.6 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
services:
redis:
image: redis:7-alpine
container_name: backgammon-redis
restart: unless-stopped
command: redis-server --appendonly yes
expose:
- "6379"
volumes:
- redis_data:/data
networks:
- backgammon-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
gnubg-service:
image: ${ECR_REGISTRY}/backgammon-gnubg-${ENVIRONMENT:-dev}:${IMAGE_TAG:-latest}
container_name: backgammon-gnubg
restart: unless-stopped
expose:
- "8080"
networks:
- backgammon-net
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
server:
image: ${ECR_REGISTRY}/backgammon-server-${ENVIRONMENT:-dev}:${IMAGE_TAG:-latest}
container_name: backgammon-server
restart: unless-stopped
expose:
- "5000"
environment:
- ASPNETCORE_ENVIRONMENT=Production
- AWS_REGION=${AWS_REGION:-us-east-1}
- DynamoDb__TableName=${DYNAMODB_TABLE_NAME:-backgammon-dev}
- Jwt__Secret=${JWT_SECRET}
- Jwt__Issuer=BackgammonServer
- Jwt__Audience=BackgammonClient
- Jwt__ExpirationDays=7
- DOMAIN=${DOMAIN:-localhost}
- Redis__ConnectionString=redis:6379
- Gnubg__ServiceUrl=http://gnubg-service:8080
networks:
- backgammon-net
depends_on:
redis:
condition: service_healthy
gnubg-service:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "-O", "/dev/null", "http://localhost:5000/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
stop_grace_period: 30s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
webclient:
image: ${ECR_REGISTRY}/backgammon-webclient-${ENVIRONMENT:-dev}:${IMAGE_TAG:-latest}
container_name: backgammon-webclient
restart: unless-stopped
ports:
- "3000:3000"
environment:
- ASPNETCORE_ENVIRONMENT=Production
networks:
- backgammon-net
depends_on:
server:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
stop_grace_period: 30s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
caddy:
image: caddy:2-alpine
container_name: backgammon-caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
environment:
- DOMAIN=${DOMAIN:-localhost}
- TLS_EMAIL=${TLS_EMAIL:-admin@example.com}
networks:
- backgammon-net
depends_on:
server:
condition: service_healthy
webclient:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
backgammon-net:
driver: bridge
volumes:
caddy_data:
caddy_config:
redis_data: