clean up dockerfile

This commit is contained in:
Samuel Newman
2026-08-10 15:07:27 +03:00
parent d7343bda07
commit 974dd7db65
4 changed files with 624 additions and 393 deletions
+14 -14
View File
@@ -6,7 +6,7 @@
#
FROM ghcr.io/pnpm/pnpm:11 AS web-build
WORKDIR /app
WORKDIR /app/bskyembed
ENV DEBIAN_FRONTEND=noninteractive
@@ -17,24 +17,18 @@ ENV CI=1
# use the pnpm version specified in package.json
ENV pnpm_config_pm_on_fail=download
COPY . .
COPY bskyembed ./
COPY bskyweb /app/bskyweb
COPY scripts/post-embed-build.js /app/scripts/post-embed-build.js
#
# Generate the embed bundle. NOTE: this will change
#
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile && \
export PATH="/app/node_modules/.bin:$PATH" && \
cd bskyembed && pnpm install --frozen-lockfile && cd .. && \
pnpm build-embed
# DEBUG
RUN find ./bskyweb/embedr-static && find ./bskyweb/embedr-templates && find ./bskyembed/dist
# hack around issue with empty directory and go:embed
RUN touch bskyweb/static/js/empty.txt
RUN touch bskyweb/static/css/empty.txt
RUN touch bskyweb/static/media/empty.txt
pnpm install --frozen-lockfile --ignore-scripts && \
pnpm build && \
pnpm build-snippet && \
node_modules/.bin/node ../scripts/post-embed-build.js
#
# Stage 2: build the embedr Go binary, embedding the assets from stage 1.
@@ -52,6 +46,12 @@ ENV GOEXPERIMENT="loopvar"
COPY --from=web-build /app/bskyweb ./bskyweb
# hack around issue with empty directory and go:embed
RUN touch \
bskyweb/static/js/empty.txt \
bskyweb/static/css/empty.txt \
bskyweb/static/media/empty.txt
RUN cd bskyweb/ && \
go mod download && \
go mod verify