mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
d482f1f708
* Refactor Docker build/runtime stages for slimmer images Split runtime and build dependencies into separate stages and build the app in a dedicated stage before runtime copy. Add a slim prune stage that removes non-runtime source trees, source maps, duplicate enterprise source videos, module test/doc folders, and extra vendored gem artifacts. This ensures bytes are removed before the final slim copy, so layer size actually decreases while keeping runtime behavior intact. * Add target-specific Docker image validation in CI Introduce script/ci/docker_validate_image.sh with validations for slim, slim-bim, and all-in-one images. Checks include runtime binary presence/absence, plugin asset/module integrity, slim pruning expectations, BIM tooling, and all-in-one API startup/embedded services. Update docker workflow to run the validator for every matrix target before push. * fix * Generate YAML-safe auto Hocuspocus secret All-in-one startup auto-generates OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET in the entrypoint. Environment overrides are parsed through YAML, so leading punctuation in the previous charset (e.g. %) could trigger Psych parsing errors and abort boot. Restrict generated secret characters to alphanumeric to keep parsing stable while preserving high entropy. * Fix all-in-one hocuspocus runtime and validation * Fix all-in-one memcached startup handover
41 lines
826 B
Bash
Executable File
41 lines
826 B
Bash
Executable File
#!/bin/bash
|
|
set -euxo pipefail
|
|
|
|
get_architecture() {
|
|
if command -v uname > /dev/null; then
|
|
ARCHITECTURE=$(uname -m)
|
|
case $ARCHITECTURE in
|
|
aarch64|arm64)
|
|
echo "arm64"
|
|
return 0
|
|
;;
|
|
ppc64le)
|
|
echo "ppc64le"
|
|
return 0
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
echo "x64"
|
|
return 0
|
|
}
|
|
|
|
ARCHITECTURE=$(get_architecture)
|
|
|
|
apt-get update -qq
|
|
apt-get install -yq --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
git \
|
|
build-essential \
|
|
libyaml-dev \
|
|
libpq-dev \
|
|
libclang-dev
|
|
|
|
if ! command -v node > /dev/null || ! command -v npm > /dev/null; then
|
|
curl -s https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${ARCHITECTURE}.tar.gz | tar xzf - -C /usr/local --strip-components=1
|
|
fi
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
truncate -s 0 /var/log/*log
|