-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
73 lines (69 loc) · 2.22 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
networks:
traefik_network:
external: true
name: "traefik_network"
volumes:
trailodyssey-redis-data:
trailodyssey-mysql-data:
trailodyssey-postgresql-data:
services:
# NEVER ADD ports DIRECTIVES IN PROD
php-fpm:
build:
context: .
dockerfile: docker/php-fpm/Dockerfile
target: main
container_name: trailodyssey-php-fpm
restart: "always"
depends_on:
postgres:
condition: service_healthy
volumes:
- "./:/var/www"
- "../data:/var/www/var/data"
- "../sessions:/var/www/var/sessions"
- "../uploads:/var/www/public/uploads"
- "../backup:/backup"
- "./docker/php-fpm/etc/ImageMagick-6:/etc/ImageMagick-6"
- "./docker/php-fpm/usr/local/etc:/usr/local/etc"
- "./docker/php-fpm/nginx.conf:/etc/nginx/nginx.conf:ro"
networks:
- "traefik_network"
environment:
IN_BUILDER: 1
labels:
# common
traefik.enable: true
traefik.http.services.trailodyssey-common.loadbalancer.server.port: 80
# trailodyssey.net
traefik.http.routers.trailodyssey-app.rule: Host(`trailodyssey.net`)
traefik.http.routers.trailodyssey-app.service: trailodyssey-common
# NEVER ADD ports DIRECTIVES IN PROD
postgres:
build: docker/postgres
container_name: trailodyssey-postgres
restart: "always"
volumes:
- "trailodyssey-postgresql-data:/var/lib/postgresql/data"
networks:
- "traefik_network"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
environment:
POSTGRES_PASSWORD:
POSTGRES_USER:
POSTGRES_DB:
PGPORT: ${POSTGRES_PORT}
# NEVER ADD ports DIRECTIVES IN PROD
redis:
image: redis:latest
container_name: trailodyssey-redis
restart: "always"
volumes:
- "trailodyssey-redis-data:/data"
networks:
- "traefik_network"