-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (78 loc) · 1.97 KB
/
docker-compose.yml
File metadata and controls
82 lines (78 loc) · 1.97 KB
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
version: "3.8"
services:
# PHP Application Container
app:
build:
context: .
dockerfile: Dockerfile
container_name: ws-app-real-php
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
environment:
DB_HOST: mariadb
DB_PORT: ${DB_PORT}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
ports:
- "${APP_PORT}:8888" # WebSocket server port
volumes:
- ./public:/app/public
- ./src:/app/src
- ./.env:/app/.env
working_dir: /app
command: php public/server.php
networks:
- app-network
restart: unless-stopped
# MariaDB Container
mariadb:
image: mariadb:11
container_name: ws-app-real-mariadb
environment:
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
MARIADB_DATABASE: ${DB_DATABASE}
ports:
- "${MARIADB_HOST_PORT}:3306"
volumes:
- ./docker/ws-app-real-mariadb:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
command:
- --bind-address=0.0.0.0
- --port=3306
- --skip-name-resolve
- --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- app-network
restart: unless-stopped
# Redis Container
redis:
image: redis:7-alpine
container_name: ws-app-real-redis
command: ["redis-server", "--appendonly", "yes", "--bind", "0.0.0.0"]
ports:
- "${REDIS_HOST_PORT}:6379"
volumes:
- ./docker/ws-app-real-redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
restart: unless-stopped
networks:
app-network:
driver: bridge