-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
78 lines (71 loc) · 1.79 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
version: "3.7"
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
mariadb:
driver: local
services:
### MariaDB ##############################################
mariadb:
image: mariadb:10.6
restart: always
volumes:
- mariadb:/var/lib/mysql
ports:
- "${MARIADB_PORT}:3306"
environment:
- MYSQL_DATABASE=${MARIADB_DATABASE}
- MYSQL_USER=${MARIADB_USER}
- MYSQL_PASSWORD=${MARIADB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
networks:
- backend
### app ################################################
app:
build: .docker/app
restart: always
volumes:
- ${CODE}:/var/www/
depends_on:
- mariadb
environment:
- MYSQL_USER=${MARIADB_USER}
- MYSQL_PASSWORD=${MARIADB_PASSWORD}
- MYSQL_DATABASE=${MARIADB_DATABASE}
- COMPOSER_MEMORY_LIMIT=-1
networks:
- backend
### nginx ################################################
nginx:
image: nginx:1.13-alpine
restart: always
environment:
- NGINX_HOST=${NGINX_HOST}
volumes:
- ${CODE}/public:/var/www/public
- ./.docker/nginx/nginx.conf.template:/etc/nginx/nginx.conf.template
# Remove the comment below to enable nginx logs to disk.
#- ./logs/nginx/:/var/log/nginx/
ports:
- "${NGINX_HTTP}:80"
- "${NGINX_HTTPS}:443"
depends_on:
- app
command: /bin/sh -c "envsubst '${NGINX_HOST}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
networks:
- backend
- frontend
### cron ################################################
cron:
build: .docker/cron
restart: always
volumes:
- ${CODE}:/var/www
depends_on:
- app
- mariadb
networks:
- backend