-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (106 loc) · 3.34 KB
/
docker-compose.yml
File metadata and controls
111 lines (106 loc) · 3.34 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
102
103
104
105
106
107
108
109
110
111
# Local full stack: PostgreSQL, objectified-rest, objectified-browser (production image).
#
# export BROWSER_SESSION_SECRET=your-local-secret-min-32-chars
# docker compose up --build
#
# Browser: http://localhost:3000
# REST: http://localhost:8000
#
# objectified-browser has no DATABASE_URL; it talks to REST only.
services:
objectified-db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: objectified
POSTGRES_PASSWORD: changeme
POSTGRES_DB: objectified
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U objectified -d objectified"]
interval: 5s
timeout: 5s
retries: 12
objectified-db-setup:
image: node:26-bookworm
depends_on:
objectified-db:
condition: service_healthy
working_dir: /work/packages/objectified-db
volumes:
- .:/work:ro
- db_flyway_cache:/root/flyway-cli
environment:
FLYWAY_HOST: objectified-db
FLYWAY_PORT: "5432"
FLYWAY_DB: objectified
FLYWAY_USER: objectified
FLYWAY_PASSWORD: changeme
DATABASE_URL: postgresql://objectified:changeme@objectified-db:5432/objectified
FLYWAY_VERSION: "12.6.1"
entrypoint:
- /bin/bash
- -ec
- |
set -euo pipefail
apt-get update -qq && apt-get install -y -qq postgresql-client curl default-jre-headless >/dev/null
if [ ! -x /root/flyway-cli/flyway-${FLYWAY_VERSION}/flyway ]; then
base="https://download.red-gate.com/maven/release/com/redgate/flyway/flyway-commandline"
curl -fsSL -o /tmp/flyway.tgz \
"${base}/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}-linux-x64.tar.gz"
mkdir -p /root/flyway-cli
tar -xzf /tmp/flyway.tgz -C /root/flyway-cli
fi
export PATH="/root/flyway-cli/flyway-${FLYWAY_VERSION}:$PATH"
./install.sh migrate
./seed.sh
objectified-rest:
image: ghcr.io/astral-sh/uv:python3.14-bookworm-slim
depends_on:
objectified-db-setup:
condition: service_completed_successfully
working_dir: /work/packages/objectified-rest
volumes:
- .:/work:ro
- rest_venv:/work/packages/objectified-rest/.venv
environment:
DATABASE_URL: postgresql+asyncpg://objectified:changeme@objectified-db:5432/objectified
APP_ENV: production
APP_RELOAD: "false"
CORS_ALLOWED_ORIGINS: http://localhost:3000,http://127.0.0.1:3000
ports:
- "8000:8000"
command:
- /bin/bash
- -ec
- |
set -euo pipefail
cd /work/packages/objectified-rest
uv sync
exec uv run uvicorn src.main:app --host 0.0.0.0 --port 8000
healthcheck:
test:
[
"CMD-SHELL",
'python -c "import urllib.request; urllib.request.urlopen(''http://127.0.0.1:8000/health'')"',
]
interval: 5s
timeout: 5s
retries: 24
start_period: 20s
objectified-browser:
build:
context: .
dockerfile: packages/objectified-browser/Dockerfile
depends_on:
objectified-rest:
condition: service_healthy
ports:
- "3000:3000"
environment:
NODE_ENV: production
OBJECTIFIED_REST_BASE_URL: http://objectified-rest:8000
BROWSER_SESSION_SECRET: ${BROWSER_SESSION_SECRET:-local-docker-session-secret-min-32-chars}
volumes:
db_flyway_cache:
rest_venv: