-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
62 lines (56 loc) · 1.73 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
version: '3.3'
networks:
front:
external:
name: ${FRONT_NETWORK}
back:
driver: bridge
services:
nginx:
container_name: ${PROJECT_NAME}_nginx
image: nginx:latest
labels:
traefik.enable: "true"
traefik.port: "80"
traefik.frontend.rule: "Host:${PROJECT_NAME}.${APP_DOMAIN}"
traefik.docker.network: "${FRONT_NETWORK}"
depends_on:
- php
networks:
- front
- back
volumes:
- ./automation/docker/nginx/nginx.conf:/etc/nginx/conf.d/my.template
- .:/var/www/html
environment:
- PROJECT_NAME=${PROJECT_NAME}
- APP_DOMAIN=${APP_DOMAIN}
command: /bin/bash -c "envsubst '$$PROJECT_NAME $$APP_DOMAIN' < /etc/nginx/conf.d/my.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
php:
container_name: ${PROJECT_NAME}_php
build: ./automation/docker/php-fpm
networks:
- back
volumes:
- .:/var/www/html:cached
db:
container_name: ${PROJECT_NAME}_db
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
networks:
- back
adminer:
container_name: ${PROJECT_NAME}_adminer
image: adminer
networks:
- front
- back
labels:
traefik.enable: "true"
traefik.port: "8080"
traefik.frontend.rule: "Host:adminer.${PROJECT_NAME}.${APP_DOMAIN}"
traefik.docker.network: "${FRONT_NETWORK}"