Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (45 loc) · 1.59 KB
/
Copy pathdocker-compose.yml
File metadata and controls
49 lines (45 loc) · 1.59 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
version: '3.8'
# PINNED, and the pin is the point. Without it Compose derives the project name from the
# working DIRECTORY, which is unique per git worktree — so every worktree that ran
# `npm run db:up` got its OWN container, volume and network. One laptop reached 13 compose
# projects, 9 of them belonging to worktrees deleted weeks earlier, holding 3.9GB.
#
# Those containers were never useful: they all publish 5432, so only one can ever bind it
# and the rest sat Created/Exited pinning a volume. Isolation between worktrees has always
# come from the per-worktree DATABASE NAMES inside one server — `autoknow_<token>_demo`,
# `<name>_j<n>_test`, `<name>_w<n>_test` (tests/helpers/worktree, scripts/dev/demo.ts) —
# never from the containers. Naming the project makes the one shared server explicit
# instead of accidental.
#
# `npm run docker:reap` reclaims what the un-pinned era left behind, and treats any
# project of ours OTHER than this name as legacy for the same reason.
name: autoknow
services:
web:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/autoknow?schema=public
volumes:
- .:/app
- /app/node_modules
- /app/.next
depends_on:
db:
condition: service_started
command: npm run dev
db:
image: pgvector/pgvector:pg16
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=autoknow
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata: