-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
154 lines (147 loc) · 4.61 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: "3.9"
services:
nginx:
container_name: ${SITE_HOST}_nginx
image: ghcr.io/serdcebolit/nginx:latest
restart: on-failure
networks:
- main_proxy_sandbox_network
- default
depends_on:
- backend
volumes:
- ./www:/home/bitrix/www
- ./entrypoints/nginx:/docker-entrypoint.d/
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx-${SITE_HOST}.rule=Host(`${SITE_HOST}.${MAIN_DOMAIN}`${ADDITIONAL_ROUTES}) || HostRegexp(`{subdomain:.*}.${SITE_HOST}.${MAIN_DOMAIN}`) && !Host(`mail.${SITE_HOST}.${MAIN_DOMAIN}`)"
- "traefik.http.routers.nginx-${SITE_HOST}.entrypoints=web,websecure"
- "traefik.http.routers.nginx-${SITE_HOST}.tls=true"
- "traefik.http.routers.nginx-${SITE_HOST}.tls.certresolver=mainresolver"
- "traefik.http.routers.nginx-${SITE_HOST}.middlewares=fixHeaders,corsHeaders"
backend:
container_name: ${SITE_HOST}_httpd
hostname: ${SITE_HOST}
image: ghcr.io/serdcebolit/httpd:${PHP_VERSION}
networks:
- main_proxy_sshproxy
- default
restart: on-failure
depends_on:
mysql:
condition: service_started
deploy_manager:
condition: service_healthy
volumes:
- ./www:/home/bitrix/www
- ./backend_cron:/var/spool/cron
- ./ssh_keys:/home/bitrix/.ssh
- ./entrypoints/httpd:/docker-entrypoint.d/
environment:
- SSH_PASSWORD=${SSH_PASSWORD}
- SSH_REDIRECT_USER=${SITE_HOST}
deploy:
resources:
limits:
memory: ${HTTPD_RAM_LIMIT:-2g}
mysql:
container_name: ${SITE_HOST}_mysql
image: ghcr.io/serdcebolit/mysql:latest
depends_on:
deploy_manager:
condition: service_healthy
networks:
- default
- main_proxy_db_network
volumes:
- mysql_data:/var/lib/mysql:delegated
- ./mysql_db_dump:/docker-entrypoint-initdb.d
environment:
- MYSQL_USER=${DB_LOGIN}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_ROOT_PASSWORD=SuperSecretRootPASSWORD
restart: on-failure
deploy:
resources:
limits:
memory: ${MYSQL_RAM_LIMIT:-2g}
mail:
container_name: ${SITE_HOST}_mail
image: mailhog/mailhog:v1.0.1
restart: on-failure
depends_on:
deploy_manager:
condition: service_healthy
networks:
- main_proxy_sandbox_network
- default
labels:
- "traefik.enable=true"
- "traefik.http.routers.mail-${SITE_HOST}.rule=Host(`mail.${SITE_HOST}.${MAIN_DOMAIN}`)"
- "traefik.http.routers.mail-${SITE_HOST}.entrypoints=websecure"
- "traefik.http.routers.mail-${SITE_HOST}.middlewares=auth"
- "traefik.http.routers.mail-${SITE_HOST}.tls=true"
- "traefik.http.routers.mail-${SITE_HOST}.tls.certresolver=mainresolver"
- "traefik.http.services.mail-${SITE_HOST}.loadbalancer.server.port=8025"
deploy_manager:
container_name: ${SITE_HOST}_deploy_manager
image: ghcr.io/serdcebolit/deploy_manager:latest
volumes:
- ./mysql_db_dump:/usr/src/app/db_entrypoint
- ./www:/usr/src/app/project
- ./docker_deploy_manager_id_rsa:/root/.ssh/id_rsa
- ./backup_tmp:/usr/src/app/backup_tmp
environment:
- DOC_ROOT=/usr/src/app
- DB_ENTRYPOINT_PATH=/usr/src/app/db_entrypoint
- PROJECT_PATH=/usr/src/app/project
- NEED_EXEC_MANAGER=${NEED_EXEC_MANAGER}
- MODE=${MODE}
- BACKUP_LINK=${BACKUP_LINK}
- REPO=${REPO}
- DB_LOGIN=${DB_LOGIN}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_HOST=mysql
healthcheck:
test: [ "CMD", "bash", "/usr/src/app/healthcheck.sh" ]
interval: 10s
timeout: 20s
retries: 500
bx_installer:
container_name: ${SITE_HOST}_bx_installer
image: ghcr.io/serdcebolit/bx_installer:latest
networks:
- default
volumes:
- ./www:/usr/src/app/project
- ./bx_installer_screenshots:/usr/src/app/bxsetup_lib/screenshots/
depends_on:
- mysql
- backend
- nginx
environment:
- NODE_ENV=production
- DB_LOGIN=${DB_LOGIN}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_HOST=mysql
- NEED_EXEC_MANAGER=${NEED_EXEC_MANAGER}
- MODE=${MODE}
- PROJECT_PATH=/usr/src/app/project
- DOC_ROOT=/usr/src/app
- BX_REDACTION=${BX_REDACTION}
- BX_ADMIN_PASSWORD=${BX_ADMIN_PASSWORD}
- OWNER_EMAIL=${OWNER_EMAIL}
- SITE_HOST=${SITE_HOST}
restart: "no"
volumes:
mysql_data:
networks:
main_proxy_sandbox_network:
external: true
main_proxy_sshproxy:
external: true
main_proxy_db_network:
external: true