feat: Reintroduces cache to docker file, adds css build step.
All checks were successful
CI / release (push) Successful in 5m55s
All checks were successful
CI / release (push) Successful in 5m55s
This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node_modules
|
||||||
28
Dockerfile
28
Dockerfile
@@ -1,16 +1,37 @@
|
|||||||
|
# ==================================================
|
||||||
|
# Build Swift Image
|
||||||
|
# ==================================================
|
||||||
FROM swift:6.0-noble AS build
|
FROM swift:6.0-noble AS build
|
||||||
|
|
||||||
WORKDIR /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.
|
# First just resolve dependencies.
|
||||||
COPY ./Package.* ./
|
COPY ./Package.* ./
|
||||||
RUN swift package resolve
|
RUN --mount=type=cache,target=/build/.build swift package resolve
|
||||||
|
|
||||||
# Copy entire repo into container
|
# Copy entire repo into container
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the static site.
|
# Build the static site.
|
||||||
RUN swift run
|
RUN --mount=type=cache,target=/build/.build swift run
|
||||||
|
|
||||||
|
# ==================================================
|
||||||
|
# Build CSS Image
|
||||||
|
# ==================================================
|
||||||
|
|
||||||
|
FROM node:23-alpine AS css
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
RUN npm install -g pnpm@latest-10
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN pnpm install && pnpm run css-build
|
||||||
|
|
||||||
# ==================================================
|
# ==================================================
|
||||||
# Run Image
|
# Run Image
|
||||||
@@ -20,6 +41,7 @@ FROM caddy:2.9.1-alpine
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=build /build/deploy .
|
COPY --from=build /build/deploy .
|
||||||
|
COPY --from=css /build/content/static/output.css ./deploy/static/output.css
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user