-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
103 lines (94 loc) · 2.2 KB
/
docker-compose.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
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
version: '3.9'
x-deploy: &deploy-template
deploy:
mode: global
x-restart-deploy: &restart-deploy-template
<<: *deploy-template
deploy:
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 120s
x-replica-deploy: &replica-deploy-template
<<: *deploy-template
deploy:
mode: replicated
replicas: 2
update_config:
parallelism: 2
delay: 10s
order: stop-first
resources:
limits:
cpus: '0.5'
memory: 1000M
reservations:
memory: 250M
x-logging: &logging-template
logging:
options:
max-size: "100m"
max-file: "10"
x-restart: &restart-template
restart: unless-stopped
services:
app:
<<: *deploy-template
<<: *logging-template
<<: *restart-template
container_name: ${APP_CONTAINER_NAME:-'styled-wotd'}
image: ${APP_IMAGE_NAME:-'styled-wotd'}
hostname: ${APP_HOST_NAME:-'styled-wotd'}
domainname: ${APP_DOMAIN_NAME:-'docker.local'}
extra_hosts:
- "server:127.0.0.1"
build:
context: './'
dockerfile: Dockerfile
labels:
- "org.opencontainers.image.authors=Alexander Rogalskiy"
- "org.opencontainers.image.vendor=Sensiblemetrics, Inc."
args:
IMAGE_SOURCE: "$IMAGE_SOURCE"
IMAGE_TAG: "$IMAGE_TAG"
VERCEL_TOKEN: "$VERCEL_TOKEN"
secrets:
- vercel_token
env_file:
- .env
# environment:
# VERCEL_TOKEN: /run/secrets/vercel_token
volumes:
- type: volume
source: appvolume
target: /usr/src/app
volume:
nocopy: true
- type: bind
source: ./data
target: /usr/src/data
healthcheck:
test: [ 'CMD-SHELL', 'nc', '-vz', 'localhost', '3000' ]
interval: 3s
retries: 15
start_period: 30s
networks:
- default
ports:
- '${IP_ADDRESS:-127.0.0.1}:${APP_SERVER_PORT:-3000}:3000'
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1450
volumes:
appvolume:
driver: local
driver_opts:
o: bind
type: none
device: ./
secrets:
vercel_token:
file: ./vercel_token.txt # put vercel token to this file