feat: Adds Dockerfile.

This commit is contained in:
2025-04-02 14:52:14 -04:00
parent 74147f8b67
commit 38141ce052

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM swift:5.10 AS build
WORKDIR /build
# First just resolve dependencies.
COPY ./Package.* ./
RUN --mount=type=cache,target=/build/.build swift package resolve \
$([ -f ./Package.resolved ] && echo "--force-resolved-versions" || true)
# Copy entire repo into container
COPY . .
# Build the static site.
RUN --mount=type=cache,target=/build/.build swift run
# ==================================================
# Run Image
# ==================================================
FROM caddy:2.9.1-alpine
WORKDIR /app
COPY --from=build /build/deploy .
EXPOSE 80
CMD ["/usr/bin/caddy", "file-server", "--root", "/app", "--listen", ":80"]