-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile.omnibus
More file actions
64 lines (49 loc) · 2.59 KB
/
Copy pathDockerfile.omnibus
File metadata and controls
64 lines (49 loc) · 2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# ── Stage 1: Build frontend ───────────────────────────────────────────────────
FROM --platform=$BUILDPLATFORM node:22-alpine AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# ── Stage 2: Runtime (Python + Node + supervisord + embedded PostgreSQL) ──────
FROM python:3.12-slim
ARG APP_VERSION=dev
ENV APP_VERSION=${APP_VERSION}
ENV TZ=UTC
# Install Node.js 22, supervisord, gosu, tzdata, and PostgreSQL
# Suppress the default cluster creation — we manage our own data dir at /app/postgres/data
RUN mkdir -p /etc/postgresql-common \
&& echo "create_main_cluster = false" > /etc/postgresql-common/createcluster.conf
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
curl \
gosu \
supervisor \
tzdata \
postgresql \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get purge -y curl \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# ── Backend ───────────────────────────────────────────────────────────────────
WORKDIR /app/backend
COPY backend/pyproject.toml backend/uv.lock ./
RUN uv sync --frozen --no-dev --no-cache
COPY backend/ .
# ── Frontend ──────────────────────────────────────────────────────────────────
WORKDIR /app/frontend
COPY --from=frontend-builder /app/frontend/dist ./dist
COPY --from=frontend-builder /app/frontend/node_modules ./node_modules
COPY --from=frontend-builder /app/frontend/package.json ./
# ── Entrypoint & supervisor configs ───────────────────────────────────────────
COPY entrypoint.sh /entrypoint.sh
COPY entrypoint.omnibus.sh /entrypoint.omnibus.sh
COPY supervisord.conf /etc/supervisor/conf.d/scrob.conf
COPY supervisord.omnibus.conf /etc/supervisor/supervisord.omnibus.conf
RUN chmod +x /entrypoint.sh /entrypoint.omnibus.sh
# Persistent data lives here — mount a volume over both paths
VOLUME ["/app/backend/data", "/app/postgres/data"]
EXPOSE 7330
ENTRYPOINT ["/entrypoint.omnibus.sh"]