feat: Initial commit.
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 2m50s

This commit is contained in:
2025-12-12 13:13:14 -05:00
commit 0c6b84a872
24 changed files with 1187 additions and 0 deletions

57
docker/Dockerfile Normal file
View File

@@ -0,0 +1,57 @@
# ==================================================
# Build Swift Image
# ==================================================
FROM docker.io/swift:6.2-noble AS build
# Install OS updates
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y
WORKDIR /build
# First just resolve dependencies.
COPY ./Package.* ./
RUN --mount=type=cache,target=/build/.build swift package resolve
# Copy entire repo into container
COPY . .
# Remove all the backtrace memory warnings.
ENV SWIFT_BACKTRACE=enable=no
# Build the static site.
RUN --mount=type=cache,target=/build/.build swift run
# ==================================================
# Build HTML Minify
# ==================================================
FROM docker.io/node:23-alpine AS css
WORKDIR /build
RUN npm install -g html-minifier
COPY . .
COPY --from=build /build/deploy ./deploy
RUN html-minifier --collapse-whitespace --input-dir ./deploy --file-ext html --output-dir deploy
# ==================================================
# Run Image
# ==================================================
FROM docker.io/caddy:latest
WORKDIR /app
COPY --from=css /build/deploy .
COPY Caddyfile /etc/caddy/Caddyfile
VOLUME /app
RUN /usr/bin/caddy fmt --overwrite /etc/caddy/Caddyfile
EXPOSE 80
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile"]