fix(docker): apply critical patches from third-party guide
Some checks failed
release server / resolve build metadata (push) Successful in 6s
release server / build fluxer server (push) Failing after 1m31s
release server / create release (push) Has been skipped
release server / release summary (push) Failing after 5s

Based on https://gist.github.com/PaulMColeman/e7ef82e05035b24300d2ea1954527f10

Changes:
- Add ca-certificates for rustup HTTPS downloads
- Install Rust and WASM toolchain for frontend WebAssembly compilation
- Copy config directory needed for FLUXER_CONFIG env var
- Set FLUXER_CONFIG so rspack can derive API endpoints
- Update ENTRYPOINT to target @fluxer/server package specifically
- Fix .dockerignore to allow build scripts and locale files

These fixes address the most critical build issues documented in the
community guide for self-hosting Fluxer.
This commit is contained in:
2026-03-01 11:12:56 -05:00
parent 2f443dc661
commit 3ad2ca08c3
3 changed files with 37 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ RUN corepack enable && corepack prepare pnpm@10.26.0 --activate
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
python3 \
make \
g++ \
@@ -107,11 +108,20 @@ RUN LOGGER_LEVEL=${LOGGER_LEVEL} envsubst '${LOGGER_LEVEL}' < fluxer_gateway/con
FROM deps AS app-build
# Install Rust and WASM target for frontend WebAssembly compilation
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup target add wasm32-unknown-unknown
COPY tsconfigs /usr/src/app/tsconfigs
COPY config/ ./config/
COPY packages/ ./packages/
COPY fluxer_app/ ./fluxer_app/
# Set FLUXER_CONFIG for rspack to derive API endpoints
ENV FLUXER_CONFIG=/usr/src/app/config/config.production.template.json
RUN cd fluxer_app && pnpm build
FROM node:24-trixie-slim AS production
@@ -196,4 +206,5 @@ ENV RELEASE_CHANNEL=${RELEASE_CHANNEL}
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD curl -f http://localhost:8080/_health || exit 1
ENTRYPOINT ["pnpm", "start"]
# Target the fluxer_server package specifically
ENTRYPOINT ["pnpm", "--filter", "@fluxer/server", "start"]