Scaffold Cloudron packaging workspace

This commit is contained in:
2025-10-02 13:39:36 -05:00
parent 482d4ff1b8
commit fe0ade1dd9
366 changed files with 4035 additions and 2493 deletions

View File

@@ -12,9 +12,16 @@
"version": "0.1.0",
"tags": ["custom", "known-element"],
"healthCheckPath": "/",
"memoryLimit": 536870912,
"httpPort": 3000,
"memoryLimit": "512M",
"addons": {
"localstorage": {}
},
"optionalAddons": {
"postgresql": {},
"redis": {},
"mysql": {},
"mongodb": {},
"sendmail": {}
}
}

View File

@@ -1,21 +1,38 @@
# syntax=docker/dockerfile:1
FROM cloudron/base:5.0.0
# syntax=docker/dockerfile:1.6
ARG APP_VERSION=latest
FROM cloudron/base:5.0.0 AS builder
WORKDIR /build
# -----------------------------------------------------------------------------
# TODO: Fetch and build PLMore
# Example:
# RUN git clone --depth 1 --branch "${APP_VERSION}" https://github.com/PLMore/PLMore source \
# && cd source \
# && npm ci \
# && npm run build
# -----------------------------------------------------------------------------
FROM cloudron/base:5.0.0
LABEL org.opencontainers.image.source="https://github.com/PLMore/PLMore"
LABEL org.opencontainers.image.description="Cloudron package for PLMore"
ARG APP_VERSION
ENV APP_VERSION=${APP_VERSION:-latest}
ENV APP_VERSION=${APP_VERSION}
# -----------------------------------------------------------------------------
# TODO: Copy build artefacts from the builder stage
# COPY --from=builder /build/source/dist /app/code
# -----------------------------------------------------------------------------
# Copy application source into image at build time
# Replace this with a multi-stage build if upstream provides Docker images.
COPY ./app /app/code
# Copy start script and make it executable
COPY ./start.sh /app/pkg/start.sh
RUN chmod +x /app/pkg/start.sh
COPY ./test /app/pkg/test
RUN chmod +x /app/pkg/start.sh /app/pkg/test/smoke.sh \
&& mkdir -p /app/data \
&& chown -R cloudron:cloudron /app
# Cloudron expects all processes to run as cloudron user
USER cloudron
WORKDIR /app/code

View File

@@ -2,19 +2,19 @@
- **Upstream repository**: https://github.com/PLMore/PLMore
- **Implementation issue**: https://projects.knownelement.com/issues/279
- **Status**: Draft scaffolding generated on $(date -u +"%Y-%m-%dT%H:%M:%SZ")
- **Generated**: 2025-10-02T17:19:01Z UTC
## Packaging Checklist
1. Review upstream deployment requirements and map them to Cloudron services (database, cache, object storage, workers).
2. Update `Dockerfile` with the correct build steps and runtime dependencies.
3. Implement `start.sh` to configure the app from Cloudron-provided environment variables and launch the primary process.
4. Edit `CloudronManifest.json` with accurate metadata, permissions, ports, addons, and health checks.
5. Add integration and smoke tests under `test/` to validate the package.
6. Document manual configuration steps, migration requirements, and known gaps in this README.
1. Map upstream services (databases, caches, workers) to Cloudron addons; remove unused entries from `optionalAddons` and enable required ones under `addons`.
2. Implement the multi-stage build in `Dockerfile` to fetch/compile the correct release of PLMore.
3. Update `start.sh` to configure the app from Cloudron environment variables and launch the primary process.
4. Replace the placeholder health checks and smoke test with real coverage.
5. Complete `CloudronManifest.json` (tagline, description, versioning, resource limits, ingress, TCP ports, etc.).
6. Document manual configuration steps, migrations, and known gaps below.
## Notes
- Replace the placeholder long-running process in `start.sh`.
- Populate the `app/` directory with the application build artefacts or git submodules.
- Use the shared packaging container (`docker/packager`) to run `cloudron build` and `cloudron install` so the host remains clean.
- Populate the `app/` directory with runtime overlays or artifacts generated during the build stage.
- Use the shared packaging container (`docker/packager`) for `cloudron build/install` to keep the host clean.
- Record decisions and operational requirements under `docs/apps/plmore/` as work progresses.

View File

@@ -4,6 +4,6 @@
"issue": "https://projects.knownelement.com/issues/279",
"repo": "https://github.com/PLMore/PLMore",
"additionalRepos": [],
"created": "2025-10-02T16:46:49Z",
"created": "2025-10-02T17:19:01Z",
"notes": "TODO: capture packaging notes"
}
}

View File

@@ -1,8 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail
# Cloudron injects configuration via environment variables and files under /run
# Use this script to render config files and launch the upstream service.
# TODO: render configuration files from CLOUDRON_* environment variables
# Example:
# envsubst < /app/pkg/config.tmpl > /run/config.yaml
# TODO: Replace the command below with the correct process supervisor.
exec /bin/sh -c "echo 'Replace start.sh with application startup logic for PLMore' && sleep infinity"
>&2 echo "start.sh for PLMore is not implemented yet."
exit 1

View File

@@ -1,16 +1,14 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail
# Basic container reachability check executed inside the packaging container.
# Replace curl target with an endpoint exposed by the app once the package is functional.
cloudron_app_url=${CLOUDRON_APP_ORIGIN:-"http://localhost"}
cloudron_app_origin=${CLOUDRON_APP_ORIGIN:-http://localhost}
http_code=$(curl -s -o /tmp/smoke.log -w "%{http_code}" "${cloudron_app_url}")
http_code=$(curl --silent --show-error --output /tmp/smoke.log --write-out "%{http_code}" "${cloudron_app_origin}/")
if [[ "${http_code}" != "200" ]]; then
echo "Unexpected HTTP status: ${http_code}" >&2
cat /tmp/smoke.log >&2
>&2 echo "Smoke test failed for PLMore: expected HTTP 200 from ${cloudron_app_origin}/, got ${http_code}"
>&2 cat /tmp/smoke.log
exit 1
fi
echo "Smoke test passed"
echo "Smoke test placeholder passed for PLMore"