-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (52 loc) · 2.07 KB
/
Copy pathdocker-compose.yml
File metadata and controls
54 lines (52 loc) · 2.07 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
# =============================================================================
# LibreFolio — Docker Compose
# =============================================================================
# Prerequisites:
# - Copy .env.example to .env and edit parameters:
# cp .env.example .env
# - Ensure your user is in the docker group:
# sudo usermod -aG docker $USER && newgrp docker
#
# Usage:
# 1. Build image: ./dev.py docker build
# 2. Start: docker compose up -d
# 3. Access: http://localhost:${PORT:-6040}
#
# Test mode (optional):
# ./dev.py docker exec server --test # start test server on :6041
# ./dev.py docker exec test db populate --force --with-static
# Access: http://localhost:${TEST_PORT:-6041}
# =============================================================================
services:
librefolio:
image: librefolio:latest
build:
context: .
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
container_name: librefolio
# The container starts as root so the entrypoint can fix bind-mount
# permissions, then drops to the 'librefolio' user via gosu.
# (Same pattern as postgres, mysql, redis official images.)
restart: unless-stopped
ports:
- "${PORT:-6040}:6040"
- "${TEST_PORT:-6041}:6041"
volumes:
- ./LibreFolio-data:/app/backend/data/prod-docker
env_file: .env
# PRIORITY: 'environment' values below OVERRIDE same-named keys from env_file.
# These overrides are mandatory inside the container:
# - LIBREFOLIO_DATA_DIR must match the container-side bind-mount path.
# - HOST must be 0.0.0.0 so the server is reachable from outside the container
# (even if the user sets HOST=127.0.0.1 in .env for local development).
environment:
- LIBREFOLIO_DATA_DIR=/app/backend/data/prod-docker
- HOST=0.0.0.0
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:6040/api/v1/system/health')"]
interval: 30s
timeout: 10s
start_period: 15s
retries: 3