Files
unpub/Dockerfile
2025-07-05 19:58:34 +02:00

37 lines
594 B
Docker

#
# --- STAGE 1: Build ---
#
FROM dart:stable AS build
# Set working directory
WORKDIR /app
# Copying all app recources
COPY res/unpub-server .
# Install dependencies
RUN dart pub get
# Create build directory
RUN mkdir -p build
# Compiling the server
RUN dart compile exe lib/server.dart -o build/server
#
# --- STAGE 2: Runtime ---
#
FROM debian:bullseye-slim AS runtime
# Set working directory
WORKDIR /app
# Coping executable
COPY --from=build /app/build/server .
# Expose http port, see docker-compose.yaml
EXPOSE 8080
# Start server, when starting the container
CMD ["./server"]