Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ ARG BUILDER_WORKDIR=/home/{{builder_user}}/app
RUN mkdir -p ${BUILDER_WORKDIR} && \
chown -R {{builder_user}}:{{builder_group}} /home/{{builder_user}}

# Enable corepack as root, before switching to the non-root build user, so
# `yarn install`/`yarn build` below run under the project's pinned package
# manager (e.g. Yarn 4 berry for Strapi). Placed before COPY so the layer is
# cached independently of application code changes.
{{builder_corepack_run}}

# Set the working directory
WORKDIR ${BUILDER_WORKDIR}

Expand Down
4 changes: 2 additions & 2 deletions checksum.sha256
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
1e0c7cc14593577dcbd2b343f39a87120bc42482f25df215c52a9373029dbd4a ./ssh-allowed-signers
2866d0bf67d0a5e284123f445e2978e4b1389e2498de9fe08c3bb43dbe0e63b5 ./dockerfile.sh
48f2d49fab1d7c52f6930bfb239874f1e61479210ceb260d0e2dd9a54c2877e6 ./gpg-list.asc
4939e1364e91cfbb589ddf645ae26530a1e4ecbb4e21c607aad8ee64c9414bca ./scripts/build-prod-node.sh
4aa825fa514655414968415bebfbec5b0252803fbba16e994b29ff1fd3004110 ./check-ssh.sh
5b7f96cd62b02c59adb90159877bd61230c3d95eca3e19a1c4e5dfb4140a986c ./scripts/build-prod-next.sh
9dbf9d726d881c43729954f9a29777c0e17d84755c9c32c2fc72a0df39f335cb ./Dockerfile.template
66ae4f55698cd5320bf009314ae59c4e34c07bd24a3a2b30540189e6089565b0 ./Dockerfile.template
aad9d75f80076441f3164f81fb9fca4f4d55ec3c021129cad29633d89b24170d ./scripts/build-prod-nginx.sh
beee0be70f1a3e4a219e142bf7400415a26dea1873ce279f95f401e682fe0fe6 ./check-gpg.sh
f15c4e8e374105e07ab7de3cf94e3ec6aaccd02a76ca9907368782612bc7e50f ./configs/nginx.conf
fb6fe984478967e5b25939954d1296b8effe74c038e469cc60d93b0e4ffae0a9 ./dockerfile.sh
fcf790d01c0ccde52a74a4fa49df33ba9a0f6210868dfa7895048a58bd613710 ./generate-yarn-npm.sh
8 changes: 5 additions & 3 deletions dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ generate_env_copy() {
# Generate corepack enable command
# ============================================================================
# Emit corepack enable as its own RUN layer when the template requires it
# (node/next). Kept as a standalone command instead of being chained onto the
# runner chmod, so the template carries no shell operators in its variables.
# (node/next/strapi). The same layer is emitted in BOTH the builder stage (so
# yarn install/build run under the project's pinned package manager) and the
# runner stage — see DOCKERFILE.md. Kept standalone (not chained onto a chmod)
# so the template carries no shell operators in its variables.
generate_corepack_run() {
if [[ -n "$COREPACK_ENABLE" ]]; then
echo "# Enable corepack to manage the project's package manager"
Expand Down Expand Up @@ -506,7 +508,7 @@ while IFS= read -r line; do
cat "$TMP_WORK/runner_commands.txt"
elif [[ "$line" == "{{env_copy}}" ]]; then
cat "$TMP_WORK/env_copy.txt"
elif [[ "$line" == "{{corepack_run}}" ]]; then
elif [[ "$line" == "{{corepack_run}}" || "$line" == "{{builder_corepack_run}}" ]]; then
cat "$TMP_WORK/corepack_run.txt"
else
echo "$line"
Expand Down
Loading