-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcompose.yml
More file actions
101 lines (97 loc) · 2.96 KB
/
compose.yml
File metadata and controls
101 lines (97 loc) · 2.96 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
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
# This file is used for running tests with an attached database
networks:
net:
name: central-webhook
services:
webhook:
image: "ghcr.io/hotosm/central-webhook:${TAG_OVERRIDE:-ci}"
build:
target: build
container_name: centralwebhook
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
# environment:
# # Override to use database on host
# CENTRAL_WEBHOOK_DB_URI: postgresql://odk:odk@host.docker.internal:5434/odk?sslmode=disable
depends_on:
db:
condition: service_healthy
# central:
# condition: service_completed_successfully
networks:
- net
# This allows usage of services running directly on the host machine
extra_hosts:
- host.docker.internal:host-gateway
restart: "no"
# Use -p 1 to avoid race condition when testing
entrypoint: go test -p 1 -timeout=2m -v ./...
db:
image: "ghcr.io/hotosm/postgres:18-http"
build:
dockerfile: pgsql-http.dockerfile
target: pg-18
container_name: centralwebhook-db
environment:
- POSTGRES_USER=odk
- POSTGRES_PASSWORD=odk
- POSTGRES_DB=odk
ports:
- "5439:5432"
networks:
- net
restart: "unless-stopped"
healthcheck:
test: pg_isready -U odk -d odk
start_period: 5s
interval: 10s
timeout: 5s
retries: 3
# # Run ODK Central migrations to initialise the database schema
# # This makes things more complex due to foreign key requirements,
# # but is probably more correct - swap to this in future
# central:
# image: ghcr.io/getodk/central-service:v2025.1.1
# container_name: centralwebhook-central
# depends_on:
# db:
# condition: service_healthy
# environment:
# # Vars required to start, but not used
# - DOMAIN=localhost
# - SSL_TYPE=upstream
# - SYSADMIN_EMAIL=test@test.org
# - HTTPS_PORT=${HTTPS_PORT:-443}
# - DB_HOST=db
# - DB_USER=odk
# - DB_PASSWORD=odk
# - DB_NAME=odk
# - DB_SSL=null
# - EMAIL_FROM=test@test.org
# - EMAIL_HOST=mail
# - EMAIL_PORT=25
# - EMAIL_SECURE=false
# - EMAIL_IGNORE_TLS=true
# - EMAIL_USER=test@test.org
# - EMAIL_PASSWORD=password
# - OIDC_ENABLED=false
# - OIDC_ISSUER_URL=https://oidc.com
# - OIDC_CLIENT_ID=xxx
# - OIDC_CLIENT_SECRET=xxx
# - SENTRY_ORG_SUBDOMAIN=o130137
# - SENTRY_KEY=3cf75f54983e473da6bd07daddf0d2ee
# - SENTRY_PROJECT=1298632
# - SENTRY_TRACE_RATE=1000
# - S3_SERVER=http://s3.amazonaws.com
# - S3_BUCKET_NAME=a-bucket
# - S3_ACCESS_KEY=xxx
# - S3_SECRET_KEY=xxx
# networks:
# - net
# restart: "on-failure:2"
# command: [ "sh", "-c", "wait-for-it db:5432 -- ./start-odk.sh & sleep 7 && echo 'Exiting cleanly after 7s' && exit 0" ]