-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
104 lines (95 loc) · 2.11 KB
/
docker-compose.yml
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
version: "3.9"
services:
etl:
build:
context: etl
target: production
env_file:
- etl/.env.docker
volumes:
- etl-data:/data
depends_on:
postgres:
condition: service_healthy
elasticsearch:
condition: service_healthy
profiles:
- etl
api:
build:
context: async_api
target: production
env_file:
- async_api/.env.docker
depends_on:
elasticsearch:
condition: service_healthy
profiles:
- api
postgres:
image: postgres:16-alpine
env_file:
- infra/postgres/.env
volumes:
- ./infra/postgres/pg_dump.sql:/docker-entrypoint-initdb.d/pg_dump.sql
- postgres-data:/data/postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U app -d movies_database" ]
interval: 5s
timeout: 5s
retries: 5
profiles:
- infra
redis:
image: redis:7.2.4-alpine
profiles:
- infra
elasticsearch:
image: elasticsearch:8.12.2
environment:
- discovery.type=single-node
- xpack.security.enabled=false
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
healthcheck:
test: curl -u elastic:elastic -s -f elasticsearch:9200/_cat/health >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
deploy:
resources:
limits:
cpus: '1.00'
memory: 1GB
reservations:
cpus: '0.50'
memory: 1GB
profiles:
- infra
init-elasticsearch:
image: curlimages/curl:8.6.0
command: /bin/sh /data/create_indexes.sh http://elasticsearch:9200
volumes:
- ./infra/elasticsearch/:/data/
depends_on:
elasticsearch:
condition: service_healthy
profiles:
- infra
nginx:
image: nginx:1.25-alpine
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./infra/nginx/configs:/etc/nginx/conf.d:ro
ports:
- "80:80"
profiles:
- api
depends_on:
api:
condition: service_started
volumes:
etl-data:
postgres-data:
elasticsearch-data:
redis-data: