-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
49 lines (47 loc) · 1.71 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
services:
path_gateway:
container_name: path_gateway
build:
context: .
args:
IMAGE_TAG: ${IMAGE_TAG:-development}
ports:
# TODO_IMPROVE: Update the port to match the actual value defined in the config yaml
# The port is a configurable value so we should find a way to dynamically set the exposed
# port in the docker compose from the value set in the config YAML.
- "3000:3000"
extra_hosts:
# Allows host machine to access the docker container; required if the
# full node RPC and gRPC URLs are running or port forwarded to localhost.
- "host.docker.internal:host-gateway"
volumes:
- ./cmd/.config.yaml:/app/.config.yaml
command: ["./path"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/healthz"]
interval: 5s
timeout: 10s
retries: 5
depends_on:
- db
# TODO_UPNEXT(#20): add a health check that looks for component ready states from the /healthz endpoint
# This DB container is provided for local development. It is not recommended
# for production use. Operator should set up their own secure DB instance.
db:
image: postgres:latest
container_name: db
restart: always
ports:
- 5432:5432
volumes:
# Initializes the database with the minimum required tables from the base schema.
- ./db/driver/sqlc/schema.sql:/docker-entrypoint-initdb.d/init.sql
# For local development, persist the database data in a .gitignore'd tmp directory.
- ./tmp/db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: pgpassword
POSTGRES_DB: postgres
healthcheck:
test: pg_isready -U postgres
interval: 5s
retries: 3