-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-stack.yml
74 lines (67 loc) · 2.01 KB
/
docker-stack.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
version: '3.7'
# Service name: ${SERVICE_NAME:=app}
# Service URL: ${SERVICE_URL:=app.mydomain.com}
# Service config: ${DOCKER_CONFIG_NAME:=symfony_env.v1}
services:
app:
image: ${DOCKER_IMAGE:-user/image:latest}
environment:
- APP_ENV=${APP_ENV:-prod}
configs:
- source: ${DOCKER_CONFIG_NAME:=symfony_env.v1}
target: /app/.env.prod.local
uid: "1000"
gid: "1000"
mode: 0400
networks:
- default
- reverse-proxy_network
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
replicas: 1
labels:
- traefik.enable=true
- traefik.http.routers.${SERVICE_NAME}.rule=Host(`${SERVICE_URL}`)
- traefik.http.routers.${SERVICE_NAME}.tls.certresolver=le
- traefik.http.routers.${SERVICE_NAME}.entrypoints=websecure
- traefik.http.services.${SERVICE_NAME}.loadbalancer.server.port=80
update_config:
order: start-first
database:
image: mariadb:${MARIADB_VERSION:-10.9.4}
environment:
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
MARIADB_DATABASE: ${MARIADB_DATABASE:-app}
MARIADB_PASSWORD: ${MARIADB_PASSWORD:-ChangeMe}
MARIADB_USER: ${MARIADB_USER:-symfony}
volumes:
- db-data:/var/lib/mysql:rw
deploy:
placement:
constraints:
- node.hostname==${DATABASE_HOST:-hostname}
adminer:
image: dehy/adminer
networks:
- default
- reverse-proxy_network
deploy:
replicas: 0
labels:
- traefik.enable=true
- traefik.http.routers.${SERVICE_NAME}-adminer.rule=Host(`adminer.${SERVICE_URL}`)
- traefik.http.routers.${SERVICE_NAME}-adminer.tls.certresolver=le
- traefik.http.routers.${SERVICE_NAME}-adminer.entrypoints=websecure
- traefik.http.services.${SERVICE_NAME}-adminer.loadbalancer.server.port=80
volumes:
db-data:
networks:
reverse-proxy_network:
external: true
configs:
${DOCKER_CONFIG_NAME}:
external: true