-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
90 lines (86 loc) · 2.16 KB
/
Copy pathcompose.yaml
File metadata and controls
90 lines (86 loc) · 2.16 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
include:
- compose.monitoring.yaml
services:
mariadb:
image: mariadb:latest
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: on-failure
environment:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: crypto
MARIADB_USER: db_user_123
MARIADB_PASSWORD: db_pass_123
volumes:
- ./data/mariadb:/var/lib/mysql
ports:
- "3306:3306"
networks:
- app-network
healthcheck:
test: ["CMD", "mariadb", "--user=root", "--password=root", "--execute=SELECT 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
api:
build:
dockerfile: docker/frankenphp/Dockerfile
context: .
target: dev
restart: on-failure
ports:
- "80:80"
volumes:
- .:/app
env_file:
- .env.dev
networks:
- app-network
depends_on:
mariadb:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
command: >
sh -c "
echo 'Running composer install...' &&
composer install &&
echo 'Waiting for database to be ready...' &&
php bin/console doctrine:database:create --if-not-exists &&
php bin/console doctrine:migrations:migrate --no-interaction &&
echo 'Migrations completed. Starting server...' &&
frankenphp run --config docker/frankenphp/Caddyfile.dev
"
scheduler:
build:
dockerfile: docker/frankenphp/Dockerfile
context: .
target: dev
restart: on-failure
volumes:
- .:/app
env_file:
- .env.dev
environment:
OTEL_SERVICE_NAME: crypto-rates-scheduler
networks:
- app-network
depends_on:
mariadb:
condition: service_healthy
api:
condition: service_healthy
command: >
sh -c "
echo 'Waiting for API service to be ready...' &&
sleep 10 &&
echo 'Starting scheduler worker...' &&
php bin/console messenger:consume scheduler_default -vv
"
networks:
app-network:
driver: bridge