v3: added opengraph support to the app, wrote README instructions incl. a Docker image
This commit is contained in:
43
Dockerfile
Normal file
43
Dockerfile
Normal file
@@ -0,0 +1,43 @@
|
||||
# ── Stage 1: build Vite frontend ─────────────────────────────────────────────
|
||||
FROM denoland/deno:2.7.5 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY deno.json deno.lock package.json ./
|
||||
COPY tsconfig*.json vite.config.ts ./
|
||||
RUN deno install
|
||||
|
||||
COPY index.html ./
|
||||
COPY public/ ./public/
|
||||
COPY src/ ./src/
|
||||
|
||||
# In same-origin deployments (API serves the frontend), no build args are needed
|
||||
# — the frontend uses relative URLs at runtime. Only set VITE_API_HOSTNAME if
|
||||
# the API lives on a different host than the frontend (e.g. a separate API server).
|
||||
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:2.7.5
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY deno.json deno.lock ./
|
||||
RUN deno install
|
||||
|
||||
COPY api/ ./api/
|
||||
COPY --from=builder /app/dist/ ./dist/
|
||||
COPY public/ ./public/
|
||||
|
||||
# Persistent data: database and user uploads must be mounted as volumes.
|
||||
VOLUME ["/app/api/sql", "/app/api/uploads"]
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["sh", "-c", "deno run -A api/sql/init.ts && exec deno run -A api/main.ts"]
|
||||
Reference in New Issue
Block a user