-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
48 lines (47 loc) · 1.42 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
48 lines (47 loc) · 1.42 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
version: '3.7'
services:
socket:
# the path of directory for build
build:
context: .
dockerfile: Dockerfile.prod
env_file: .env
ports:
- "8000:8000"
expose: # internal ports
- "8000"
environment:
NODE_ENV: production
SERVER_PORT: 8000
REDIS_HOST: "redis"
image: "ts-express-socketio_socket"
links:
- "redis"
deploy:
mode: global
redis:
image: "redis:alpine"
expose:
- "6379"
deploy:
replicas: 1
# how the service should be rollback if failing updates
rollback_config:
# all container rollback simultanenously
parallelism: 0
update_config:
# number of container rollback in a single time.
parallelism: 1
restart_policy:
condition: on-failure
# duration required for restart attempts
delay: 10s
# maximum amount of attempts
max_attempts: 3
resources:
limits:
# 50% of single core
cpus: "0.5"
# 50M (Megabytes) of memory
memory: 50M
# docker-compose up -d --no-deps --build --no-cache <service_name>