-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
633 additions
and
177 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
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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
BUILDER_NAME?=craft-builder | ||
BUILD_PLATFORM?=linux/$(shell arch) | ||
BUILD_COMMAND?=docker buildx build --load --platform ${BUILD_PLATFORM} --builder ${BUILDER_NAME} | ||
IMAGE_NAMESPACE?=nystudio107 | ||
PHP_PROD_NAMESPACE?=php-prod-base | ||
PHP_DEV_NAMESPACE?=php-dev-base | ||
NODE_NAMESPACE?=node-dev-base | ||
|
||
PHP_VERSIONS?=php-7.4-alpine php-8.0-alpine php-8.1-alpine php-8.2-alpine php-8.3-alpine php-8.4-alpine | ||
NODE_VERSIONS?=node-14-alpine node-16-alpine node-18-alpine node-20-alpine node-22-alpine | ||
|
||
.PHONY: all create-builder php $(PHP_VERSIONS) node $(NODE_VERSIONS) | ||
|
||
# Build all base images | ||
all: php node | ||
|
||
# Ensure a builder exists for docker buildx | ||
create-builder: | ||
-@if [ ! "$$(docker buildx inspect ${BUILDER_NAME} 2>/dev/null)" ]; then \ | ||
echo "No builder exists, creating builder: ${BUILDER_NAME}" ; \ | ||
docker buildx create --name ${BUILDER_NAME} ; \ | ||
fi | ||
|
||
# Build all php base images | ||
php:$(PHP_VERSIONS) | ||
|
||
# Build specific php prod & dev base images | ||
$(PHP_VERSIONS):create-builder | ||
${BUILD_COMMAND} -t ${IMAGE_NAMESPACE}/${PHP_PROD_NAMESPACE}:$(subst php-,,$@) ${PHP_PROD_NAMESPACE}/$@ | ||
${BUILD_COMMAND} -t ${IMAGE_NAMESPACE}/${PHP_DEV_NAMESPACE}:$(subst php-,,$@) ${PHP_DEV_NAMESPACE}/$@ | ||
|
||
# Build all node base images | ||
node:$(NODE_VERSIONS) | ||
|
||
# Build specific node base images | ||
$(NODE_VERSIONS):create-builder | ||
${BUILD_COMMAND} -t ${IMAGE_NAMESPACE}/${NODE_NAMESPACE}:$(subst node-,,$@) ${NODE_NAMESPACE}/$@ |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM node:22-alpine | ||
|
||
# Install packages for headless chrome | ||
RUN apk update \ | ||
&& \ | ||
apk add --no-cache nmap \ | ||
&& \ | ||
echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \ | ||
&& \ | ||
echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \ | ||
&& \ | ||
apk update \ | ||
&& \ | ||
apk add --no-cache \ | ||
# Packages needed for npm install of mozjpeg & cwebp, can't --virtual and apk del later | ||
# Pre-builts do not work on alpine for either: | ||
# ref: https://github.com/imagemin/imagemin/issues/168 | ||
# ref: https://github.com/imagemin/cwebp-bin/issues/27 | ||
autoconf \ | ||
automake \ | ||
build-base \ | ||
g++ \ | ||
gcc \ | ||
glu \ | ||
libc6-compat \ | ||
libtool \ | ||
libpng-dev \ | ||
libxxf86vm \ | ||
make \ | ||
nasm \ | ||
# Misc packages | ||
nano \ | ||
# Image optimization packages | ||
gifsicle \ | ||
jpegoptim \ | ||
libpng-dev \ | ||
libwebp-tools \ | ||
libjpeg-turbo-dev \ | ||
libjpeg-turbo-utils \ | ||
optipng \ | ||
pngquant \ | ||
# Headless Chrome packages | ||
chromium \ | ||
harfbuzz \ | ||
"freetype>2.8" \ | ||
ttf-freefont \ | ||
nss | ||
|
||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | ||
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser | ||
ENV CHROME_BIN /usr/bin/chromium-browser | ||
ENV LIGHTHOUSE_CHROMIUM_PATH /usr/bin/chromium-browser |
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
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
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,4 +1,4 @@ | ||
xdebug.mode=develop,debug,profile | ||
xdebug.mode=develop,debug,profile,coverage | ||
xdebug.start_with_request=trigger | ||
xdebug.client_host=host.docker.internal | ||
xdebug.output_dir = "/var/www/project/cms/storage/logs" |
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
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,4 +1,4 @@ | ||
xdebug.mode=develop,debug,profile | ||
xdebug.mode=develop,debug,profile,coverage | ||
xdebug.start_with_request=trigger | ||
xdebug.client_host=host.docker.internal | ||
xdebug.output_dir = "/var/www/project/cms/storage/logs" |
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
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,4 +1,4 @@ | ||
xdebug.mode=develop,debug,profile | ||
xdebug.mode=develop,debug,profile,coverage | ||
xdebug.start_with_request=trigger | ||
xdebug.client_host=host.docker.internal | ||
xdebug.output_dir = "/var/www/project/cms/storage/logs" |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM nystudio107/php-prod-base:8.3-alpine | ||
|
||
# Install packages | ||
RUN set -eux; \ | ||
# Packages needed only for build | ||
apk add --no-cache --virtual .build-deps \ | ||
# Dependencies required for running "phpize"; the $PHPIZE_DEPS env var is inherited from the parent image | ||
# These get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) | ||
$PHPIZE_DEPS \ | ||
# Build deps | ||
autoconf \ | ||
dpkg-dev \ | ||
dpkg \ | ||
file \ | ||
g++ \ | ||
gcc \ | ||
libc-dev \ | ||
make \ | ||
pkgconf \ | ||
re2c \ | ||
libtool \ | ||
linux-headers \ | ||
wget \ | ||
&& \ | ||
# pecl PHP extensions | ||
pecl install \ | ||
xdebug \ | ||
&& \ | ||
# Enable PHP extensions | ||
docker-php-ext-enable \ | ||
xdebug \ | ||
&& \ | ||
# Remove the build deps | ||
apk del .build-deps \ | ||
&& \ | ||
# Clean out directories that don't need to be part of the image | ||
rm -rf /tmp/* /var/tmp/* | ||
|
||
# Copy the `xdebug.ini` file into place for xdebug | ||
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Copy the `zzz-docker-php.ini` file into place for php | ||
COPY zzz-docker-php.ini /usr/local/etc/php/conf.d/ | ||
|
||
# Copy the `zzz-docker-php-fpm.conf` file into place for php-fpm | ||
COPY zzz-docker-php-fpm.conf /usr/local/etc/php-fpm.d/ |
Oops, something went wrong.