-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (112 loc) · 2.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
121 lines (112 loc) · 2.72 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
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
services:
php:
build:
context: .
dockerfile: Dockerfile
args:
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: yii2-app-custom
user: "${UID:-1000}:${GID:-1000}"
volumes:
- ./:/app
environment:
PHP_ENABLE_XDEBUG: 0
XDEBUG_CONFIG: client_host=host.docker.internal client_port=9003
PHP_IDE_CONFIG: serverName=yii2-book-catalog
depends_on:
redis:
condition: service_started
env_file: .env
nginx:
image: nginx:alpine
ports:
- '${APP_PORT:-8000}:80'
volumes:
- ./:/app
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${DB_NAME:-yii2basic}
MYSQL_USER: ${DB_USER:-yii2}
MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
ports:
- '${MYSQL_PUBLIC_PORT:-33060}:3306'
volumes:
- mysql_data:/var/lib/mysql
env_file: .env
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u$DB_USER", "-p$DB_PASSWORD"]
timeout: 5s
retries: 10
interval: 5s
pgsql:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${DB_NAME:-yii2basic}
POSTGRES_USER: ${DB_USER:-yii2}
POSTGRES_PASSWORD: ${DB_PASSWORD:-secret}
ports:
- '${PGSQL_PUBLIC_PORT:-54320}:5432'
volumes:
- pgsql_data:/var/lib/postgresql/data
env_file: .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-yii2} -d ${DB_NAME:-yii2basic}"]
timeout: 5s
retries: 10
interval: 5s
redis:
image: redis:7-alpine
ports:
- '${REDIS_PUBLIC_PORT:-6379}:6379'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
queue:
build:
context: .
dockerfile: Dockerfile
args:
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: yii2-app-custom
user: "${UID:-1000}:${GID:-1000}"
volumes:
- ./:/app
restart: on-failure
stop_signal: SIGTERM
stop_grace_period: 60s
environment:
- SMS_API_KEY=${SMS_API_KEY:-MOCK_KEY}
command: php yii queue/listen --verbose --isolate
depends_on:
- redis
- php
env_file: .env
selenium:
image: selenium/standalone-chrome:latest
shm_size: 2gb
ports:
- '4444:4444'
swagger-ui:
image: swaggerapi/swagger-ui
ports:
- "${SWAGGER_PORT:-8081}:8080"
volumes:
- ./docs/api/openapi.yaml:/app/openapi.yaml
environment:
SWAGGER_JSON: /app/openapi.yaml
k6:
image: grafana/k6:latest
volumes:
- ./tests/load:/scripts
volumes:
mysql_data:
pgsql_data: