-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
70 lines (64 loc) · 1.95 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
version: '3.7'
services:
reverse-proxy:
image: 'traefik:latest'
command:
- '--providers.docker=true'
- '--providers.docker.exposedbydefault=true'
- '--entrypoints.web.address=:80'
ports:
- '80:80'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
mysql:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- 3306:3306
volumes:
- ./database:/var/lib/mysql
api:
build: .
environment:
- NODE_ENV=development
labels:
# Enable reverse proxy to this app.
- traefik.enable=true
- traefik.http.routers.website.entrypoints=web
- traefik.http.routers.website.rule=Host(`api.localhost`)
# Schedules tasks
- 'chadburn.enabled=false'
- 'chadburn.job-exec.process_tables.no-overlap=true'
- 'chadburn.job-exec.process_tables.schedule=@every 10s' # Process tables every 5 seconds
- 'chadburn.job-exec.process_tables.command=php /var/www/html/tasks/process_tables.php'
volumes:
- ./public_html:/var/www/html:rw
- ./.env:/var/www/.env:ro # Placed here to prevent accidental inclusion in image.
depends_on:
- mysql
# Chadburn is CRON alternative written in Go and designed for Docker environments.
chadburn:
image: premoweb/chadburn:latest
depends_on:
- api
- mysql
command: daemon
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
depends_on:
- mysql
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.phpmyadmin.rule=Host(`${PMA_HOSTNAME}`)'
- 'traefik.http.routers.phpmyadmin.entrypoints=web'
environment:
PMA_HOST: mysql
PMA_USER: ${MYSQL_USER}
PMA_PASSWORD: ${MYSQL_PASSWORD}
PMA_PORT: ${MYSQL_PORT}