-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
81 lines (75 loc) · 1.46 KB
/
docker-compose.prod.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
version: "3.11"
services:
laravel:
build:
args:
user: www
uid: 1000
context: ./
dockerfile: Dockerfile.prod
restart: unless-stopped
working_dir: /var/www
volumes:
- .:/var/www
ports:
- 9000
networks:
- app
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
db:
image: mysql:8
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
- ./docker.prod/mysql:/docker-entrypoint-initdb.d
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
SERVICE_TAGS: dev
SERVICE_NAME: mysql
ports:
- 3306
networks:
- app
healthcheck:
test: mysql -h 127.0.0.1 -P 3306 -u"$$MYSQL_USER" -p"$$MYSQL_PASSWORD"
interval: 5s
timeout: 20s
retries: 30
web:
image: nginx:1-alpine
restart: unless-stopped
working_dir: /var/www
volumes:
- ./:/var/www
- ./docker.prod/nginx:/etc/nginx/conf.d
ports:
- 8080:80
depends_on:
- laravel
networks:
- app
redis:
image: "redis:7-alpine"
ports:
- 6379
volumes:
- "redis:/data"
networks:
- app
healthcheck:
test: ["CMD", "redis-cli", "ping"]
retries: 3
timeout: 5s
volumes:
db_data:
redis:
networks:
app:
driver: bridge