-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
103 lines (98 loc) · 2.31 KB
/
docker-compose.yaml
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
services:
rabbitmq:
image: rabbitmq:3.10.7-management
container_name: rabbitmq_container
restart: always
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error},{default,error}]
volumes:
- ./rabbitmqdata:/var/lib/rabbitmq
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics check_port_connectivity"]
interval: 30s
timeout: 20s
retries: 3
networks:
- backend
postgres:
image: postgres:latest
container_name: postgres_container
environment:
POSTGRES_DB: testdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- ./pgdata:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d testdb"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
networks:
- backend
minio:
container_name: minio
image: minio/minio:latest
volumes:
- ./miniodata:/data
ports:
- 9000:9000
- 9001:9001
restart: always
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
entrypoint: sh
command: -c "mc mb /data/${MINIO_BUCKET} && /usr/bin/minio server /data --console-address ':9001'"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- backend
app:
build:
context: app
dockerfile: Dockerfile
command: bash -c "alembic upgrade head && fastapi run app/main.py"
env_file:
- .env
restart: on-failure
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
rabbitmq:
condition: service_healthy
ports:
- 8000:8000
networks:
- frontend
- backend
frontend:
build:
context: frontend
dockerfile: Dockerfile
command: pnpm run dev
restart: on-failure
ports:
- 3000:3000
networks:
- frontend
networks:
frontend:
driver: bridge
backend:
driver: bridge