forked from OurHike/OurHike
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (34 loc) · 1.45 KB
/
Copy pathdocker-compose.yml
File metadata and controls
35 lines (34 loc) · 1.45 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
# A local Postgres for the backend, for machines with Docker but no Postgres
# installed. `scripts/local-postgres.sh` uses this automatically when it can't
# find a native server; there is nothing wrong with running it directly either:
#
# docker compose -f backend/docker-compose.yml up -d
#
# The image tag matches what CI's service container and Supabase both run
# (17.6, checked 2026-08-07), so "works locally" means the same major version
# as "works in production" - which the sandbox's own preinstalled 16 cannot.
services:
postgres:
image: postgres:17
container_name: ourhike-postgres
environment:
# These defaults are the ones app/config.py and tests/conftest.py fall
# back to. They are local-only credentials for a database holding
# throwaway data - production's come from the environment and are never
# written down anywhere in this repository.
POSTGRES_USER: ${OURHIKE_PG_USER:-ourhike}
POSTGRES_PASSWORD: ${OURHIKE_PG_PASSWORD:-ourhike}
POSTGRES_DB: ${OURHIKE_PG_DEV_DB:-ourhike_dev}
ports:
- "${OURHIKE_PG_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${OURHIKE_PG_USER:-ourhike}"]
interval: 5s
timeout: 5s
retries: 10
volumes:
# Named, so a `docker compose down` (without -v) keeps whatever you were
# working on. `docker compose down -v` is the reset button.
- ourhike-pgdata:/var/lib/postgresql/data
volumes:
ourhike-pgdata: