-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
54 lines (51 loc) · 1.35 KB
/
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
# This file is used for running tests with an attached database
networks:
net:
name: fmtm-splitter
services:
odkhook:
image: "ghcr.io/hotosm/odk-webhook:${TAG_OVERRIDE:-ci}"
build:
target: build
container_name: odkhook
volumes:
# Mount local files
- ./go.mod:/app/go.mod:ro
- ./go.sum:/app/go.sum:ro
- ./main.go:/app/main.go:ro
- ./main_test.go:/app/main_test.go:ro
- ./db:/app/db:ro
- ./webhook:/app/webhook:ro
- ./parser:/app/parser:ro
# environment:
# # Override to use database on host
# ODK_WEBHOOK_DB_URI: postgresql://odk:[email protected]:5434/odk?sslmode=disable
# ODK_WEBHOOK_WEBHOOK_URL:
depends_on:
db:
condition: service_healthy
networks:
- net
# This allows usage of services running directly on the host machine
extra_hosts:
- host.docker.internal:host-gateway
restart: "no"
entrypoint: go test -v .
db:
image: "postgis/postgis:17-3.5-alpine"
container_name: odkhook-db
environment:
- POSTGRES_USER=odk
- POSTGRES_PASSWORD=odk
- POSTGRES_DB=odkhook
ports:
- "5439:5432"
networks:
- net
restart: "unless-stopped"
healthcheck:
test: pg_isready -U odk -d odkhook
start_period: 5s
interval: 10s
timeout: 5s
retries: 3