-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
86 lines (80 loc) · 1.79 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
version: '3'
name: ${PROJECT_NAME}
volumes:
db_data:
services:
nginx:
user: ${UID:-1000}
build:
context: ./nginx
dockerfile: Dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
ports:
- "${PORT_NGINX}:80"
volumes_from:
- cms
depends_on:
- cms
healthcheck:
test: service nginx status || exit 1
interval: 15s
timeout: 5s
retries: 5
restart: always
cms:
build:
context: ./cms
dockerfile: Dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- ./../${PROJECT_NAME}:/var/www/html/public:delegated
environment:
DB_HOST: database
restart: always
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
mailhog:
image: mailhog/mailhog:latest
restart: unless-stopped
logging:
driver: 'none' # disable saving logs
ports:
#- "11025:1025" # smtp server
- "${PORT_MAILHOG}:8025" # web ui
redis:
image: redis:alpine
restart: unless-stopped
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 15s
timeout: 5s
retries: 5
ports:
- "${PORT_REDIS}:6379"
database:
build:
context: ./mysql
dockerfile: Dockerfile
restart: unless-stopped
volumes:
- ./mysql/lib:/var/lib/mysql
- ./mysql/init:/init
ports:
- "${PORT_MYSQL}:3306"
command: --init-file /init/install.sql
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-p${MYSQL_PASSWORD}" ]
interval: 15s
timeout: 5s
retries: 5
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
SERVICE_TAGS: dev
SERVICE_NAME: mysql