-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (49 loc) · 1.43 KB
/
docker-compose.yml
File metadata and controls
51 lines (49 loc) · 1.43 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
services:
api:
build: .
# Dev: live code from the repo + auto-reload (no image rebuild after editing Python).
command:
- uvicorn
- app.main:app
- --host
- 0.0.0.0
- --port
- "8000"
- --reload
ports:
- "8000:8000"
# Optional file: Docker Compose v2.24+; clone works without copying .env first.
env_file:
- path: .env
required: false
volumes:
# Named volume: DB is NOT ./data on the host. Use `docker compose down -v` to reset.
- bookshelf_data:/app/data
- ./app:/app/app:ro
- ./config.py:/app/config.py:ro
frontend:
image: node:22-bookworm-slim
working_dir: /app
# Root only for chmod; Vite runs as uid 1000 (image user "node"). node_modules is chmodded
# so any host UID can share the bind mount (avoids EACCES on .vite-temp for non-1000 users).
ports:
- "5173:5173"
environment:
API_PROXY_TARGET: http://api:8000
volumes:
- ./frontend:/app
command:
- sh
- -c
- |
set -e
mkdir -p /app/node_modules
if [ ! -x node_modules/.bin/vite ]; then
setpriv --reuid=1000 --regid=1000 --init-groups -- sh -c 'umask 000; npm ci'
fi
chmod -R a+rwX /app/node_modules
exec setpriv --reuid=1000 --regid=1000 --init-groups -- sh -c 'umask 000; exec npm run dev -- --host 0.0.0.0'
depends_on:
- api
volumes:
bookshelf_data: