From 30bb801f9fc2f0f8ebdcaaf540e6a92c38390805 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 6 Jul 2025 02:10:44 +0200 Subject: [PATCH] fix: :green_heart: Fix Docker image builds --- Dockerfile | 13 +++++-------- Worker.Dockerfile | 14 ++++++-------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9198c0a1..bf08eea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ # Node is required for building the project -FROM imbios/bun-node:1-20-alpine AS base - -RUN apk add --no-cache libstdc++ +FROM imbios/bun-node:latest-23-alpine AS base # Install dependencies into temp directory # This will cache them and speed up future builds @@ -22,20 +20,19 @@ COPY --from=install /temp/node_modules /temp/node_modules # Build the project WORKDIR /temp -RUN bun run build +RUN bun run build api WORKDIR /temp/dist # Copy production dependencies and source code into final image FROM oven/bun:1.2.18-alpine # Install libstdc++ for Bun and create app directory -RUN apk add --no-cache libstdc++ && \ - mkdir -p /app +RUN mkdir -p /app COPY --from=build /temp/dist /app/dist COPY entrypoint.sh /app -LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.dev)" +LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.com)" LABEL org.opencontainers.image.source="https://github.com/versia-pub/server" LABEL org.opencontainers.image.vendor="Versia Pub" LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later" @@ -51,4 +48,4 @@ WORKDIR /app ENV NODE_ENV=production ENTRYPOINT [ "/bin/sh", "/app/entrypoint.sh" ] # Run migrations and start the server -CMD [ "bun", "run", "index.js" ] +CMD [ "bun", "run", "api.js" ] diff --git a/Worker.Dockerfile b/Worker.Dockerfile index 817df22a..1c7dae39 100644 --- a/Worker.Dockerfile +++ b/Worker.Dockerfile @@ -1,7 +1,5 @@ # Node is required for building the project -FROM imbios/bun-node:1-20-alpine AS base - -RUN apk add --no-cache libstdc++ +FROM imbios/bun-node:latest-23-alpine AS base # Install dependencies into temp directory # This will cache them and speed up future builds @@ -22,20 +20,19 @@ COPY --from=install /temp/node_modules /temp/node_modules # Build the project WORKDIR /temp -RUN bun run build:worker +RUN bun run build worker WORKDIR /temp/dist # Copy production dependencies and source code into final image FROM oven/bun:1.2.18-alpine # Install libstdc++ for Bun and create app directory -RUN apk add --no-cache libstdc++ && \ - mkdir -p /app +RUN mkdir -p /app COPY --from=build /temp/dist /app/dist COPY entrypoint.sh /app -LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.dev)" +LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.com)" LABEL org.opencontainers.image.source="https://github.com/versia-pub/server" LABEL org.opencontainers.image.vendor="Versia Pub" LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later" @@ -47,7 +44,8 @@ ARG GIT_COMMIT ENV GIT_COMMIT=$GIT_COMMIT # CD to app -WORKDIR /app/dist +WORKDIR /app ENV NODE_ENV=production +ENTRYPOINT [ "/bin/sh", "/app/entrypoint.sh" ] # Run migrations and start the server CMD [ "bun", "run", "worker.js" ]