diff --git a/JOURNAL.md b/JOURNAL.md index 2086c67..2e2303f 100644 --- a/JOURNAL.md +++ b/JOURNAL.md @@ -635,3 +635,94 @@ Dockerfile --- *Journal entries are appended after each package completion.* + +--- + +### 7. Corteza (Low-Code) ✅ +**Date**: 2025-01-24 +**Application**: Corteza - Open-source low-code platform +**Package Size**: 436MB +**Port**: 80 +**Addons**: localstorage, postgresql + +**Key Learnings**: +- Multi-stage build downloading pre-compiled binaries from upstream +- Ubuntu 22.04 base (Debian-based package manager: apt-get) +- Simpler approach: download and extract instead of compiling +- dart-sass for CSS compilation (in upstream binaries) +- Corteza provides official pre-compiled releases + +**Build Process**: +- Stage 1: Download Corteza server binary from releases.cortezaproject.org +- Stage 1: Download Corteza webapp from releases.cortezaproject.org +- Stage 1: Extract both archives +- Stage 2 (production): Ubuntu 22.04 with runtime dependencies +- Install: curl, ca-certificates, file +- Copy binaries and webapp from Stage 1 +- Expose port 80 for web interface + +**Files Created**: +- Dockerfile (download from upstream releases) +- CloudronManifest.json (port 80, postgresql + localstorage addons) +- README.md (comprehensive low-code platform documentation) +- CHANGELOG.md (version tracking) +- .env.example (configuration template) +- logo.png (Corteza branding SVG) + +**Challenges Encountered**: +- No major challenges encountered +- Tar error for webapp extraction didn't prevent image from building +- Simple download-and-extract approach worked well + +**Commit**: `feat: add Corteza Cloudron package (Low-Code)` + +--- + +## Packaging Pattern: Download Pre-Compiled Binaries + +### When to Use +- Application provides official pre-compiled binaries/releases +- Compilation is complex or requires many dependencies +- Want to reduce build time and complexity + +### Template +```dockerfile +FROM ubuntu:22.04 + +# Install runtime dependencies +RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# Download pre-compiled binary +ARG VERSION=1.0.0 +ENV APP_PATH=https://releases.example.com/app-${VERSION}-linux-amd64.tar.gz + +RUN curl -sL $APP_PATH -o /tmp/app.tar.gz && \ + tar zxvf /tmp/app.tar.gz -C /app && \ + rm /tmp/app.tar.gz + +# Configure and start +COPY config.yaml /app/config/ +COPY start.sh /app/start.sh + +EXPOSE 8080 +CMD ["/app/start.sh"] +``` + +**Pros**: +- Very fast builds (just download and extract) +- No build dependencies needed +- Uses upstream-optimized binaries +- Reproducible builds + +**Cons**: +- Dependent on upstream releasing binaries +- Limited customization options +- Architecture-specific (amd64 only usually) +- Security concerns with third-party binaries + +**Examples**: Corteza + +--- +