-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
116 lines (112 loc) · 2.85 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
version: '3.4'
services:
traefik:
image: traefik:latest
container_name: traefik
ports:
- "80:80"
- "443:443"
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik-config/traefik-non-secure.yml:/traefik.yml:ro
- ./traefik-config/configurations:/configurations
labels:
- "traefik.enable=true"
- "traefik.docker.network=app-network"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.rule=Host(`traefik.app.local`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=user-auth@file"
networks:
- app-network
#PHP Service
php:
build:
context: ./docker-files
dockerfile: php.dockerfile
image: dahaltn/php-fpm:8.1
container_name: php
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: php
SERVICE_TAGS: dev
working_dir: /var/www/html
volumes:
- ./app:/var/www/html
- ./php-config/php-development.ini:/usr/local/etc/php/conf.d/local.ini
networks:
- app-network
#Nginx Service
webserver:
image: nginx:alpine
container_name: webserver
restart: unless-stopped
tty: true
volumes:
- ./app:/var/www/html
- ./server-config/nginx/app.conf:/etc/nginx/conf.d/app.conf
networks:
- app-network
labels:
- "traefik.enable=true"
- "traefik.docker.network=app-network"
- "traefik.http.routers.web.entrypoints=web"
- "traefik.http.routers.web.rule=HostRegexp(`{subdomain:[a-z0-9]+}.laravel.app.local`, `laravel.app.local`, `app.local`)"
depends_on:
- db
- php
#MySQL Service
db:
image: mysql:5.7.22
container_name: db
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: laravel
MYSQL_USER: lara
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: P@ssword
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- dbdata:/var/lib/mysql/
- ./mysql-config/mysql.cnf:/etc/mysql/mysql.cnf
networks:
- app-network
adminer:
image: adminer:latest
restart: always
container_name: adminer
labels:
- "traefik.enable=true"
- "traefik.docker.network=app-network"
- "traefik.http.routers.adminer.entrypoints=web"
- "traefik.http.routers.adminer.rule=Host(`adminer.app.local`)"
environment:
ADMINER_PLUGINS: 'tables-filter tinymce'
networks:
- app-network
depends_on:
- db
# Redis
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
ports:
- 6379:6379
networks:
- app-network
#Docker Networks
networks:
app-network:
driver: bridge
external: false
#Volumes
volumes:
dbdata:
driver: local