-
-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathcompose.yml
More file actions
66 lines (66 loc) · 2.07 KB
/
compose.yml
File metadata and controls
66 lines (66 loc) · 2.07 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
name: todo-api-microservice
services:
postgres:
image: postgres:16.2-bullseye
ports:
- "5432:5432"
environment:
POSTGRES_DB: dbname
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: password
POSTGRES_USER: user
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 10
start_period: 40s
postgres_setup:
image: ghcr.io/jackc/tern:v2.3.2
restart: no
depends_on:
postgres:
condition: service_healthy
volumes:
- ./db/migrations/:/db/
entrypoint: ["/tern", "migrate", "--migrations", "/db/", "--conn-string", "postgres://user:password@postgres:5432/dbname?sslmode=disable"]
vault:
image: vault:1.12.4
ports:
- 8300:8300
cap_add:
- IPC_LOCK
environment:
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8300
VAULT_DEV_ROOT_TOKEN_ID: myroot
elasticsearch:
# Make sure the docker image listed here matches the one used in `internal/elasticsearch/task_test.go`.
image: elasticsearch:7.17.9
ports:
- 9200:9200
- 9300:9300
environment:
- discovery.type=single-node
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
interval: 20s
timeout: 1s
retries: 5
elasticsearch_setup:
image: curlimages/curl:8.8.0
restart: no
depends_on:
elasticsearch:
condition: service_healthy
# Make sure the this payload is the same as the one used in `internal/elasticsearch/task_test.go`.
entrypoint: ["curl", "-X", "PUT", "-H", "Content-Type: application/json", "http://elasticsearch:9200/tasks", "-d", "{\"mappings\":{\"properties\":{\"id\":{\"type\":\"keyword\"},\"description\":{\"type\":\"text\"}}}}"]
memcached:
# Make sure the docker image listed here matches the one used in `internal/memcached/task_test.go`.
image: memcached:1.6.19-alpine3.17
ports:
- 11211:11211
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 11211 || exit 1"]
interval: 20s
timeout: 1s
retries: 5