-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
79 lines (79 loc) · 2.08 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
version: '3.9'
services:
php:
build:
context: .
dockerfile: ./Dockerfile
container_name: antbot-php
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: "php-fpm-healthcheck || exit 1"
interval: 15s
retries: 5
timeout: 60s
mysql:
image: mysql:latest
container_name: antbot-mysql
restart: unless-stopped
user: "1000:50"
environment:
MYSQL_HOST: ${DB_HOST}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
volumes:
- ${PWD}/docker/mysql/initdb.d:/docker-entrypoint-initdb.d
- mysql-volume:/var/lib/mysql
ports:
- "${DB_PORT}:3306"
healthcheck:
test: "mysql -w --connect-timeout 5 --user=${DB_USERNAME} --password=${DB_PASSWORD} -e 'show databases;'"
interval: 15s
retries: 10
timeout: 60s
redis:
image: bitnami/redis:latest
container_name: antbot-redis
restart: unless-stopped
user: "0:0"
command: redis-server --appendonly yes --requirepass "${REDIS_PASSWORD}"
volumes:
- redis-volume:/data
ports:
- "${REDIS_PORT}:6379"
healthcheck:
test: "redis-cli -a ${REDIS_PASSWORD} --raw redis_healthcheck ping"
interval: 15s
retries: 10
timeout: 60s
nginx:
image: nginx:stable
container_name: antbot-nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ${PWD}/:/var/www/html
- ${PWD}/docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
php:
condition: service_healthy
volumes:
mysql-volume:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/docker/mysql/volume
redis-volume:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/docker/redis/volume