-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
139 lines (131 loc) · 4.31 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: "3.8"
networks:
public:
name: traefik_web
driver: bridge
webapp:
name: ${DOCKER_NAME}_webapp
driver: bridge
services:
laravel:
container_name: "${DOCKER_NAME}_laravel"
build:
context: ./.devops/docker/laravel
args:
- PUID=${DOCKER_PUID}
- PGID=${DOCKER_PGID}
- DOCKER_USER=laravel
volumes:
- ./:/var/www:cached
expose:
- "9000"
tty: true
environment:
- "DB_HOST=${DB_HOST}"
- "DB_PORT=${DB_PORT}"
- "REDIS_HOST=${REDIS_HOST}"
- "REDIS_PORT=${REDIS_PORT}"
- "TZ=${APP_TIMEZONE}"
networks:
- webapp
server:
container_name: "${DOCKER_NAME}_server"
build:
context: ./.devops/docker/server
# restart: on-failure
volumes:
- ./:/var/www:cached
- ./.devops/docker/server/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- ./.devops/docker/server/conf/default.conf:/etc/nginx/sites-available/default.conf:ro
- ./.devops/docker/data/logs/nginx/:/var/log/nginx:rw
expose:
- 80
- 443
depends_on:
- laravel
networks:
- webapp
- public
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_web"
- "traefik.http.routers.${DOCKER_NAME}_http.rule=Host(`${BASE_DOMAIN}`)"
- "traefik.http.services.${DOCKER_NAME}_http.loadbalancer.server.port=80"
- "traefik.http.services.${DOCKER_NAME}_http.loadbalancer.passhostheader=true"
environment:
TZ: '${APP_TIMEZONE}'
database:
image: postgres:12-alpine
container_name: "${DOCKER_NAME}_database"
volumes:
- ./.devops/docker/data/postgres:/var/lib/postgresql/data:rw
# restart: on-failure
ports:
- ${DB_PORT}:5432
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
networks:
- webapp
- public
redis:
image: redis:5-alpine
container_name: "${DOCKER_NAME}_redis"
volumes:
- ./.devops/docker/data/redis:/data
ports:
- ${REDIS_PORT}:6379
networks:
- webapp
mailhog:
image: mailhog/mailhog:latest
container_name: "${DOCKER_NAME}_mailhog"
ports:
- 1025:1025
# - 8025:8025
expose:
- 8025
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_mailhog"
- "traefik.http.routers.${DOCKER_NAME}_mailhog.rule=Host(`mail.localhost`)"
- "traefik.http.services.${DOCKER_NAME}_mailhog.loadbalancer.server.port=8025"
- "traefik.http.services.${DOCKER_NAME}_mailhog.loadbalancer.passhostheader=true"
networks:
- webapp
- public
minio:
image: minio/minio
container_name: "${DOCKER_NAME}_minio"
command: server --address 0.0.0.0:${DOCKER_MINIO_PORT} /export
entrypoint:
- "minio"
volumes:
- ./.devops/docker/data/minio/data:/export
- ./.devops/docker/data/minio/config:/root/.minio
ports:
- ${DOCKER_MINIO_PORT}:${DOCKER_MINIO_PORT}
environment:
- MINIO_ACCESS_KEY=${DOCKER_MINIO_ACCESS_KEY}
- MINIO_SECRET_KEY=${DOCKER_MINIO_SECRET_KEY}
networks:
- webapp
- public
traefik:
image: traefik:2.4
container_name: "${DOCKER_NAME}_traefik"
# restart: always
ports:
- "${DOCKER_WEB_PORT}:80"
- "${DOCKER_WEB_PORT_SECURE}:443"
networks:
- public
volumes:
- ./.devops/docker/traefik/conf/traefik.toml:/etc/traefik/traefik.toml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- traefik.enable=true
- tls.certificates.stores=default
- traefik.http.routers.api.rule=Host(`dashboard.docker.localhost`)
- traefik.http.routers.api.service=api@internal