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:
@@ -38,8 +38,12 @@
|
||||
**/yarn-debug.log*
|
||||
**/yarn-error.log*
|
||||
/fluxer_app/src/data/emojis.json
|
||||
/fluxer_app/src/locales/*/messages.js
|
||||
# Don't block locale files - they're needed for the build
|
||||
#!/fluxer_app/src/locales/*/messages.js
|
||||
dev
|
||||
!fluxer_app/dist
|
||||
!fluxer_app/dist/**
|
||||
!fluxer_devops/cassandra/migrations
|
||||
# Allow build scripts and locale files
|
||||
!**/scripts/
|
||||
!**/locales/
|
||||
|
||||
21
NOTES.md
21
NOTES.md
@@ -87,6 +87,25 @@ If the registry requires a different format, check your Gitea container registry
|
||||
|
||||
## Resources
|
||||
|
||||
- Third-party guide: https://gist.github.com/PaulMColeman/e7ef82e05035b24300d2ea1954527f10
|
||||
- **Third-party self-hosting guide**: https://gist.github.com/PaulMColeman/e7ef82e05035b24300d2ea1954527f10
|
||||
- Documents 20 gotchas and fixes for building/deploying Fluxer
|
||||
- Critical for successful Docker build
|
||||
- Domain: uwu.lc
|
||||
- Gitea: git.i5.wtf
|
||||
|
||||
## Known Build Issues from Third-Party Guide
|
||||
|
||||
The guide documents these critical Dockerfile fixes needed:
|
||||
1. ✅ Fix package path (app → app_proxy)
|
||||
2. ✅ Add Rust/WASM toolchain (frontend needs WebAssembly)
|
||||
3. ✅ Add ca-certificates (for rustup HTTPS download)
|
||||
4. ✅ Fix .dockerignore (unblock build scripts and locale files)
|
||||
5. ✅ Set FLUXER_CONFIG env var (rspack needs this)
|
||||
6. ✅ Copy config directory for build process
|
||||
7. ✅ Update ENTRYPOINT to target fluxer_server package
|
||||
|
||||
Additional fixes that may be needed (will address if they come up):
|
||||
- Empty CDN endpoint handling (frontend code)
|
||||
- Content Security Policy adjustments
|
||||
- NATS configuration
|
||||
- LiveKit webhook configuration
|
||||
|
||||
@@ -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