fix(docker): apply critical patches from third-party guide
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:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user