-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(SLB-207): use php as builder image
To be able to install php extensions required by composer
- Loading branch information
Showing
1 changed file
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# ==================================================================================================== | ||
# BUILDER IMAGE | ||
# ==================================================================================================== | ||
FROM uselagoon/node-18-builder as builder | ||
FROM uselagoon/php-8.2-cli-drupal as builder | ||
|
||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 | ||
|
||
|
@@ -12,10 +12,10 @@ RUN npm install -g [email protected] && pnpm config set store-dir /tmp/cache/pnpm | |
COPY pnpm-lock.yaml .npmrc /app/ | ||
#COPY patches /app/patches | ||
RUN --mount=type=cache,target=/tmp/cache pnpm fetch && \ | ||
# There is a bug in pnpm: `pnpm fetch` creates _some_ node_modules folders | ||
# with _some_ packages. This can lead to an incomplete package installation. | ||
# So we remove them now. | ||
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + | ||
# There is a bug in pnpm: `pnpm fetch` creates _some_ node_modules folders | ||
# with _some_ packages. This can lead to an incomplete package installation. | ||
# So we remove them now. | ||
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + | ||
|
||
# Install composer dependencies. | ||
# They may contain directive definitions required by prep scripts. | ||
|
@@ -32,9 +32,9 @@ WORKDIR /app | |
# Copy the all package sources, install and prepare them. | ||
COPY . /app | ||
RUN --mount=type=cache,target=/tmp/cache pnpm i && \ | ||
pnpm turbo:prep && \ | ||
# Remove all node_modules to reduce the size of the image. | ||
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + | ||
pnpm turbo:prep && \ | ||
# Remove all node_modules to reduce the size of the image. | ||
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + | ||
|
||
# Deploy apps. | ||
RUN --mount=type=cache,target=/tmp/cache pnpm deploy --filter "@custom/cms" /tmp/.deploy/cms --prod | ||
|
@@ -94,22 +94,22 @@ ENV ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION | |
RUN echo "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" | ||
|
||
RUN apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \ | ||
echo "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m 1QIDAQAB -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ | ||
wget "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ | ||
mv /etc/nsswitch.conf /etc/nsswitch.conf.bak && \ | ||
apk add --no-cache --force-overwrite \ | ||
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ | ||
mv /etc/nsswitch.conf.bak /etc/nsswitch.conf && \ | ||
rm "/etc/apk/keys/sgerrand.rsa.pub" && \ | ||
(/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) && \ | ||
echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \ | ||
apk del glibc-i18n && \ | ||
apk del .build-dependencies && \ | ||
rm "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" | ||
echo "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m 1QIDAQAB -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ | ||
wget "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ | ||
mv /etc/nsswitch.conf /etc/nsswitch.conf.bak && \ | ||
apk add --no-cache --force-overwrite \ | ||
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ | ||
mv /etc/nsswitch.conf.bak /etc/nsswitch.conf && \ | ||
rm "/etc/apk/keys/sgerrand.rsa.pub" && \ | ||
(/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) && \ | ||
echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \ | ||
apk del glibc-i18n && \ | ||
apk del .build-dependencies && \ | ||
rm "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" | ||
|
||
RUN apk add --no-cache sqlite curl | ||
|
||
|