forked from Graffino/Graffino-Docker-Ninja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
98 lines (93 loc) · 3.67 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
version: '3.8'
services:
php-fpm:
image: graffino/php:v1
restart: unless-stopped
container_name: ${COMPOSE_PROJECT_NAME}-php-fpm
build:
context: .
dockerfile: .docker/php/Dockerfile
args:
DOCKER_PHP_EXTENSIONS: ${DOCKER_PHP_EXTENSIONS}
DOCKER_COMPOSER_GIT_TOKEN: ${DOCKER_COMPOSER_GIT_TOKEN}
volumes:
- ./:/var/www:rw
- node_modules:/var/www/node_modules
- ./.docker/logs/php-fpm/:/var/log/php-fpm/
- ./.docker/logs/cron/:/var/log/cron/
restart: unless-stopped
networks:
- servers
- proxy
# Exposed ports are disabled by default you may enable them below
# ports:
# - '${DOCKER_PHP_XDEBUG_EXPOSED_PORT}:${DOCKER_PHP_XDEBUG_PORT}'
# - '${DOCKER_PHP_EXPOSED_PORT}:${DOCKER_PHP_PORT}'
env_file:
- .env
depends_on:
- mariadb
nginx:
image: graffino/nginx:v1
restart: unless-stopped
container_name: ${COMPOSE_PROJECT_NAME}-nginx
build:
context: .
dockerfile: .docker/nginx/Dockerfile
volumes:
- ./:/var/www:rw
- ./.docker/logs/nginx/:/var/log/nginx
- ./.docker/nginx/conf.d:/etc/nginx/templates
restart: unless-stopped
networks:
- servers
- proxy
# Exposed ports are disabled by default you may enable them below
# ports:
# - '${DOCKER_NGINX_EXPOSED_PORT}:${DOCKER_NGINX_PORT}'
env_file:
- .env
depends_on:
- php-fpm
labels:
- traefik.enable=true
- traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=http
- traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${TRAEFIK_HOSTNAME}`)
- traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=traefik-auth
- traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.entrypoints=https
- traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.rule=Host(`${TRAEFIK_HOSTNAME}`)
- traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.tls=true
- traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.tls.certresolver=${TRAEFIK_RESOLVER}
- traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.tls.domains[0].main=${TRAEFIK_HOSTNAME}
# - traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.tls.domains[0].sans=${TRAEFIK_DOMAIN}
- traefik.http.routers.${COMPOSE_PROJECT_NAME}-secure.middlewares=traefik-auth
- traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https_redirect.redirectscheme.permanent=true
- traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-auth.basicauth.users=${TRAEFIK_USER}:${TRAEFIK_PASSWORD}
- traefik.http.services.${COMPOSE_PROJECT_NAME}-secure.loadbalancer.server.port=80
mariadb:
image: graffino/mariadb:v1
restart: unless-stopped
container_name: ${COMPOSE_PROJECT_NAME}-mariadb
build:
context: .
dockerfile: .docker/mariadb/Dockerfile
volumes:
- ./.docker/logs/mariadb:/var/log/mysql
- mariadb:/var/lib/mysql
restart: unless-stopped
networks:
- servers
# Exposed ports are disabled by default you may enable them below
# ports:
# - '${DOCKER_DB_EXPOSED_PORT}:${DOCKER_DB_PORT}'
env_file:
- .env
networks:
servers:
driver: bridge
proxy:
external: true
volumes:
mariadb:
node_modules: