-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
49 lines (49 loc) · 1.2 KB
/
docker-compose.yaml
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
version: '3'
services:
traefik:
image: "traefik:v2.4"
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.metrics.address=:8082"
- "--metrics.prometheus=true"
- "--metrics.prometheus.entryPoint=metrics"
ports:
- "80:80"
- "8082:8082"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8081:80"
environment:
APP_DEBUG: "true"
APP_ENV: "dev"
APP_KEY: "base64:DJYTvaRkEZ/YcQsX3TMpB0iCjgme2rhlIOus9A1hnj4="
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: app_database
DB_USERNAME: app_user
DB_PASSWORD: app_password
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`localhost`)"
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: app_database
MYSQL_USER: app_user
MYSQL_PASSWORD: app_password
MYSQL_ROOT_PASSWORD: app_root_password
volumes:
- db_data:/var/lib/mysql
volumes:
db_data: