f
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
This commit is contained in:
parent
1c64a18856
commit
dc0bad38f3
1 changed files with 48 additions and 0 deletions
48
mnemo_cards_backend/Dockerfile
Normal file
48
mnemo_cards_backend/Dockerfile
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
# syntax=docker/dockerfile:1.7
|
||||||
|
|
||||||
|
# --- Build stage ------------------------------------------------------------
|
||||||
|
FROM dart:stable-sdk AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Cache dependencies
|
||||||
|
COPY pubspec.* ./
|
||||||
|
RUN dart pub get
|
||||||
|
|
||||||
|
# Copy sources
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Compile to native executable
|
||||||
|
RUN dart compile exe lib/main.dart -o /app/server
|
||||||
|
|
||||||
|
# --- Runtime stage ----------------------------------------------------------
|
||||||
|
FROM debian:bookworm-slim AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends ca-certificates openssl curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# App binary
|
||||||
|
COPY --from=build /app/server /app/server
|
||||||
|
|
||||||
|
# Static/assets needed at runtime (adjust as required)
|
||||||
|
COPY public /app/public
|
||||||
|
COPY data /app/data
|
||||||
|
|
||||||
|
# Writable dirs for isar/backups by default
|
||||||
|
RUN mkdir -p /app/isar /app/backups
|
||||||
|
|
||||||
|
ENV PORT=8081 \
|
||||||
|
ADDRESS=0.0.0.0 \
|
||||||
|
ISAR_DIR=/app/isar \
|
||||||
|
BACKUP_DIR=/app/backups \
|
||||||
|
WORKDIR=/app
|
||||||
|
|
||||||
|
|
||||||
|
EXPOSE 8081
|
||||||
|
|
||||||
|
# Healthcheck (tune path if different)
|
||||||
|
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=5 \
|
||||||
|
CMD curl -f http://127.0.0.1:${PORT}/health || exit 1
|
||||||
|
|
||||||
|
CMD ["/app/server", "-a", "0.0.0.0", "-p", "8081", "--isar", "/app/isar", "--backup", "/app/backups", "--workdir", "/app"]
|
||||||
Loading…
Reference in a new issue