-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
114 lines (113 loc) · 3.33 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
version: '3.2'
services:
config_traefik:
build:
context: ./configs
dockerfile: traefik.dockerfile
stdin_open: true
volumes:
- type: volume
source: config_traefik
target: "/etc/traefik"
watchtower:
image: v2tec/watchtower
container_name: "caesarapp-watchtower"
command: --cleanup --label-enable --interval 300
labels:
- "traefik.enable=false"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
traefik:
image: traefik:1.6.2-alpine # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Træfik to listen to docker
networks:
- frontend
- backend
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
- "443:443"
depends_on:
- config_traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- 'config_traefik:/etc/traefik/'
labels:
- traefik.port=8080
client:
image: 4xxi/caesarapp-web-client
depends_on:
- php
networks:
- frontend
labels:
- "traefik.enable=true"
- "traefik.backend=client"
- "traefik.domain=${DOMAIN}"
- "traefik.frontend.rule=Host:${CLIENT_HOSTNAME}"
- "traefik.frontend.entryPoints=http,https"
- "com.centurylinklabs.watchtower.enable=true"
environment:
SERVER_HTTP_PORT: "${SERVER_HTTP_PORT}"
SERVER_HOSTNAME: "${SERVER_HOSTNAME}"
CLIENT_HTTP_PORT: "${CLIENT_HTTP_PORT}"
CLIENT_HOSTNAME : "${CLIENT_HOSTNAME}"
BASE_URL: "${BASE_URL}"
BASE_API_URL: "${BASE_API_URL}"
php:
image: 4xxi/caesarapp-server:latest
depends_on:
- redis
volumes:
- type: volume
source: code
target: "/var/www/html"
expose:
- "9000"
entrypoint: ./config/docker/docker-entrypoint.sh
environment:
- APP_ENV=${ENV}
- REDIS_HOST=redis
- CORS_ALLOW_ORIGIN=${CLIENT_HOSTNAME}
- REDIS_PORT=${REDIS_PORT}
labels:
- "traefik.enable=false"
- "com.centurylinklabs.watchtower.enable=true"
networks:
- backend
nginx:
image: 4xxi/nginx:flex
depends_on:
- php
volumes:
- type: volume
source: code
target: "/var/www/html"
- 'logs:/var/log/nginx'
networks:
- backend
labels:
- "traefik.domain=${DOMAIN}"
- "traefik.frontend.rule=PathPrefix:/api/*"
- "traefik.frontend.entryPoints=http,https"
- "traefik.enable=true"
redis:
image: 'redis:alpine'
environment:
- REDIS_PORT=${REDIS_PORT}
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
networks:
- backend
volumes:
- 'redis:/etc/redis/database/caesarapp'
labels:
- "traefik.enable=false"
networks:
backend:
frontend:
volumes:
redis:
code: {}
config_traefik: {}
logs: {}
db: {}