halkyon/apps/todo/halkyon_todo_server/Dockerfile
Tizian 「ティツィアーン」 314a901fa1
chore: Halkyon Todo's scaffold joins the repository in apps/todo
Its server, client and app as `serverpod create` made them, with the
switch to server-side sessions that was waiting uncommitted, as files:
its one commit holds the scaffold alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-22 18:11:03 +02:00

58 lines
1.6 KiB
Docker

# Build from the project root with:
# docker build -f halkyon_todo_server/Dockerfile .
# Build stage
FROM dart:3.12.2 AS build
# Create a minimal workspace that preserves locked server dependency versions.
WORKDIR /app
COPY pubspec.lock .
COPY halkyon_todo_server halkyon_todo_server
RUN printf '%s\n' \
'name: _' \
'environment:' \
' sdk: ^3.12.2' \
'workspace:' \
' - halkyon_todo_server' \
> pubspec.yaml
RUN dart pub get
# Compile the server executable.
WORKDIR /app/halkyon_todo_server
RUN dart build cli --target bin/main.dart --output build
RUN mv build/bundle/bin/main build/bundle/bin/server
# Add a fallback for the copy of possibly missing directories.
RUN mkdir -p config web migrations
# Final stage
FROM alpine:latest
WORKDIR /app
# Environment variables
ENV runmode=production
ENV serverid=default
ENV logging=normal
ENV role=monolith
# Copy runtime dependencies
COPY --from=build /runtime/ /
# Copy compiled server executable and native libraries
COPY --from=build /app/halkyon_todo_server/build/bundle/ ./
# Copy configuration files and resources
COPY --from=build /app/halkyon_todo_server/config/ config/
COPY --from=build /app/halkyon_todo_server/web/ web/
COPY --from=build /app/halkyon_todo_server/migrations/ migrations/
# This file is required to enable the endpoint log filter in Insights.
COPY --from=build /app/halkyon_todo_server/lib/src/generated/protocol.yaml lib/src/generated/protocol.yaml
# Expose ports
EXPOSE 8080
EXPOSE 8081
EXPOSE 8082
# Define the entrypoint command
ENTRYPOINT ./bin/server --mode=$runmode --server-id=$serverid --logging=$logging --role=$role