Files
gerbeur/Dockerfile
khannurien ed7695663e
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
v3: correctly using SITE_NAME across the app, added notifications on comments
2026-04-08 20:12:30 +00:00

44 lines
1.2 KiB
Docker

# ── Stage 1: build Vite frontend ─────────────────────────────────────────────
FROM denoland/deno:2.7.11 AS builder
WORKDIR /app
COPY deno.json deno.lock package.json ./
COPY tsconfig*.json vite.config.ts lingui.config.ts ./
RUN deno install
COPY index.html ./
COPY public/ ./public/
COPY scripts/ ./scripts/
COPY src/ ./src/
# VITE_API_* are only needed when the API lives on a different host than the frontend.
ARG VITE_API_PROTOCOL
ARG VITE_API_HOSTNAME
ARG VITE_API_PORT
ENV VITE_API_PROTOCOL=$VITE_API_PROTOCOL \
VITE_API_HOSTNAME=$VITE_API_HOSTNAME \
VITE_API_PORT=$VITE_API_PORT
RUN deno task build
# ── Stage 2: runtime ──────────────────────────────────────────────────────────
FROM denoland/deno:alpine-2.7.11
RUN apk add --no-cache ffmpeg
WORKDIR /app
COPY deno.json deno.lock ./
RUN deno install
COPY api/ ./api/
COPY --from=builder /app/dist/ ./dist/
# Persistent data: database and uploaded/generated files must be mounted as volumes.
VOLUME ["/app/api/sql", "/app/api/uploads"]
EXPOSE 8000
CMD ["deno", "task", "start"]