-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
129 lines (120 loc) · 4.24 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
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
version: '3.9'
services:
# Strichliste Frontend
frontend:
image: "ghcr.io/shokinn/strichliste-frontend:${DOCKER_STRICHLISTE_VERSION_TAG}"
# This docker-compose does not include a traefik container,
# however a configuration through labels is provided for ease of use when it's deployed with traefik.
labels:
traefik.enable: 'true'
traefik.docker.network: strichliste-docker_frontend # You have to specify the exact name of the network here as shown by `docker network ls`.
traefik.http.routers.strichliste.entrypoints: websecure # Define your own https entrypoint here.
traefik.http.routers.strichliste.rule: Host(`${DOCKER_NAME}.${DOCKER_DEFAULT_SERVICE_DOMAIN}`)
traefik.http.routers.strichliste.tls: 'true'
traefik.http.routers.strichliste.tls.certresolver: le_production # Define your own cert resolver here.
traefik.http.services.strichliste.loadbalancer.server.scheme: http
traefik.http.services.strichliste.loadbalancer.server.port: '8080'
environment:
- "APP_ENV:prod"
- MARIADB_USER=${DOCKER_MARIADB_USER}
- MARIADB_PASSWORD=${DOCKER_MARIADB_PASSWORD}
- MARIADB_DATABASE=${DOCKER_MARIADB_DATABASE}
- MARIADB_HOST=${DOCKER_MARIADB_HOST}
restart: unless-stopped
hostname: ${DOCKER_NAME}.${DOCKER_DEFAULT_SERVICE_DOMAIN}
ports:
- "8080:8080"
networks:
- reverse_proxy
- frontend
depends_on:
- backend
# Strichlise backend
backend:
image: "ghcr.io/shokinn/strichliste-backend:${DOCKER_STRICHLISTE_VERSION_TAG}"
user: '1000'
volumes:
- ./config/services.yaml:/var/www/strichliste/config/services.yaml
- ./config/strichliste.yaml:/var/www/strichliste/config/strichliste.yaml
- ./config/doctrine.yaml:/var/www/strichliste/config/packages/doctrine.yaml
environment:
- "APP_ENV:prod"
- MARIADB_USER=${DOCKER_MARIADB_USER}
- MARIADB_PASSWORD=${DOCKER_MARIADB_PASSWORD}
- MARIADB_DATABASE=${DOCKER_MARIADB_DATABASE}
- MARIADB_HOST=${DOCKER_MARIADB_HOST}
- DATABASE_URL=mysql://${DOCKER_MARIADB_USER}:${DOCKER_MARIADB_PASSWORD}@${DOCKER_MARIADB_HOST}/${DOCKER_MARIADB_DATABASE}
restart: unless-stopped
networks:
- frontend
- db
depends_on:
database:
condition: service_healthy
# Strichlise database
database:
image: "mariadb:${DOCKER_DB_VERSION_TAG}"
volumes:
- strichlistedb:/var/lib/mysql
environment:
- MARIADB_ROOT_PASSWORD=${DOCKER_MARIADB_ROOT_PASSWORD}
- MARIADB_USER=${DOCKER_MARIADB_USER}
- MARIADB_PASSWORD=${DOCKER_MARIADB_PASSWORD}
- MARIADB_DATABASE=${DOCKER_MARIADB_DATABASE}
- MARIADB_HOST=${DOCKER_MARIADB_HOST}
- MARIADB_MYSQL_LOCALHOST_USER=y
restart: unless-stopped
networks:
- db
healthcheck:
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 30s
# Database backup
db-backup:
build: ./docker/backup
environment:
MYSQL_CONTAINER_NAME: database
MYSQL_ROOT_PASSWORD: ${DOCKER_MARIADB_ROOT_PASSWORD}
volumes:
- /etc/localtime:/etc/localtime:ro
- strichlistedb_backup:/db_backups # Change the hostpath to a directory where you want to store your backups
restart: unless-stopped
networks:
- db
depends_on:
database:
condition: service_healthy
volumes:
strichlistedb:
strichlistedb_backup:
networks:
reverse_proxy:
driver: bridge
ipam:
driver: default
labels:
com.docker.network.bridge.name: docker2
com.docker.network.bridge.enable_ip_masquerade: true
com.docker.network.bridge.enable_icc: true
com.docker.network.driver.mtu: 1500
frontend:
driver: bridge
ipam:
driver: default
labels:
com.docker.network.bridge.name: docker2
com.docker.network.bridge.enable_ip_masquerade: true
com.docker.network.bridge.enable_icc: true
com.docker.network.driver.mtu: 1500
db:
driver: bridge
ipam:
driver: default
labels:
com.docker.network.bridge.name: docker2
com.docker.network.bridge.enable_ip_masquerade: true
com.docker.network.bridge.enable_icc: true
com.docker.network.driver.mtu: 1500