Repository navigation
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
58 lines (56 loc) · 2.41 KB
/
Copy pathdocker-compose.postgres.yml
File metadata and controls
58 lines (56 loc) · 2.41 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
##
## Local PostgreSQL for Oxy Move.
##
## Only the database — the app itself runs on the host via `bun run dev:backend`,
## so there is nothing else in this compose file.
##
## Usage:
## docker compose -f docker-compose.postgres.yml up -d postgres
## docker compose -f docker-compose.postgres.yml logs -f postgres
## docker compose -f docker-compose.postgres.yml down -v # wipe (data is disposable)
##
## Then in packages/backend/.env (copy it from .env.example):
## DATABASE_URL=postgres://oxymove:oxymove@127.0.0.1:5437/oxymove_dev
##
## and apply the schema:
## bun run db:migrate --target-database=oxymove_dev
##
services:
postgres:
# Plain Postgres, pinned to 17 to match the managed instance Oxy backends
# run against — a floating major is a floating set of behaviours to debug.
#
# NOT the PostGIS image, because nothing in this scaffold's schema names an
# extension-provided type: `src/db/migrate.ts` ships an EMPTY extension list
# and `ensureExtensions([])` opens no connection at all. Add `postgis` to
# that list AND swap this image to `postgis/postgis:17-3.5` together, the
# first time a column needs `geography` — the image alone is not enough
# (a freshly created database is cloned from `template1`, which the image
# never seeds), and neither is the extension list alone.
image: postgres:17-alpine
container_name: move-postgres-dev
restart: unless-stopped
environment:
POSTGRES_USER: oxymove
POSTGRES_PASSWORD: oxymove
# `-` is not legal in an unquoted Postgres identifier, so this is the
# scheme (letters and digits only) rather than the package slug.
POSTGRES_DB: oxymove_dev
ports:
# 5437, and loopback-only. NOT 5432: an Oxy developer machine routinely has
# several backends' local databases up at once, and 5432 through 5436 are
# already spoken for (oxy-api, Mention, Homiio, Mercaria, CrowdSource). A
# port collision does not fail loudly once the container is running — it
# connects to somebody else's database — so pick the next free port here
# and in packages/backend/.env if 5437 is taken too.
- '127.0.0.1:5437:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U oxymove -d oxymove_dev']
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
volumes:
- move-postgres-data:/var/lib/postgresql/data
volumes:
move-postgres-data: