-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
71 lines (71 loc) · 1.71 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
---
version: '3'
services:
index:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
container_name: index
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
volumes: [esdata:/usr/share/elasticsearch/data]
ports: [9200:9200, 9300:9300]
healthcheck:
test: [CMD-SHELL, curl -s http://localhost:9200 >/dev/null || exit 1]
interval: 1m
timeout: 20s
retries: 5
start_period: 1m
queue:
image: redis:6.0
container_name: queue
ports: [6379:6379]
healthcheck:
test: [CMD, redis-cli, ping]
interval: 10s
timeout: 5s
retries: 3
database:
image: postgres:14
container_name: database
environment: [POSTGRES_USER=postgres, POSTGRES_HOST_AUTH_METHOD=trust]
env_file: [.env.docker]
ports: [5432:5432]
volumes: [pgdata:/var/lib/postgresql/data]
healthcheck:
test: [CMD, pg_isready, -U, postgres]
interval: 1m
timeout: 30s
retries: 5
start_period: 1m
restart: unless-stopped
api:
build:
context: .
dockerfile: Dockerfile
container_name: api
env_file: [.env.docker]
ports: [8080:80]
depends_on:
index:
condition: service_healthy
queue:
condition: service_healthy
database:
condition: service_healthy
healthcheck:
test: [CMD, curl, -f, http://localhost/healthcheck/]
interval: 1m
timeout: 30s
retries: 5
start_period: 30s
restart: unless-stopped
volumes:
esdata:
pgdata: