forked from AlexRogalskiy/android-patterns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
91 lines (83 loc) · 1.91 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
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:-'android-patterns'}
image: ${APP_IMAGE_NAME:-'android-patterns'}
hostname: ${APP_HOST_NAME:-'android-patterns'}
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'
env_file:
- .env
volumes:
- type: volume
source: appvolume
target: /usr/src/app
volume:
nocopy: true
- type: bind
source: ${APP_DATA_DIR:-./data}
target: /usr/src/data
healthcheck:
test: ['CMD-SHELL', 'nc', '-vz', 'localhost', '8000']
interval: 3s
retries: 15
start_period: 30s
networks:
- default
ports:
- '${IP_ADDRESS:-127.0.0.1}:${APP_SERVER_PORT:-8000}:8000'
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1450
volumes:
appvolume:
driver: local
driver_opts:
o: bind
type: none
device: ./