-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
67 lines (63 loc) · 2.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
67 lines (63 loc) · 2.17 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
# Single compose for dev and tests (PHP + integration tests with MySQL/PostgreSQL).
# MySQL/PostgreSQL are not published on the host; PHP reaches them as mysql:3306 and postgres:5432 on the bridge network.
name: anonymize-bundle
services:
php:
build:
context: .
dockerfile: Dockerfile
container_name: anonymize-bundle-php
working_dir: /app
volumes:
- .:/app
- composer-cache:/root/.composer/cache
- coverage-data:/app/coverage
environment:
- COMPOSER_ALLOW_SUPERUSER=1
- DATABASE_URL=mysql://${MYSQL_USER:-test_user}:${MYSQL_PASSWORD:-test_password}@mysql:3306/${MYSQL_DATABASE:-anonymize_test}?serverVersion=8.0&charset=utf8mb4
- DATABASE_URL_POSTGRES=postgresql://${POSTGRES_USER:-test_user}:${POSTGRES_PASSWORD:-test_password}@postgres:5432/${POSTGRES_DB:-anonymize_test}?serverVersion=16&charset=utf8
command: ["tail", "-f", "/dev/null"]
networks:
- anonymize-bundle-network
depends_on:
mysql:
condition: service_healthy
postgres:
condition: service_healthy
mysql:
image: mysql:8.0
container_name: anonymize-bundle-mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-test_password}
MYSQL_DATABASE: ${MYSQL_DATABASE:-anonymize_test}
MYSQL_USER: ${MYSQL_USER:-test_user}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-test_password}
networks:
- anonymize-bundle-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-test_password}"]
interval: 5s
timeout: 3s
retries: 10
postgres:
image: postgres:16-alpine
container_name: anonymize-bundle-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-test_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-test_password}
POSTGRES_DB: ${POSTGRES_DB:-anonymize_test}
networks:
- anonymize-bundle-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-test_user}"]
interval: 5s
timeout: 3s
retries: 10
volumes:
composer-cache:
driver: local
coverage-data:
driver: local
networks:
anonymize-bundle-network:
driver: bridge