-
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.
Ajout de fichiers de configuration et de test, mise à jour de la conf…
…iguration Nginx et Caddy, et suppression de Dockerfile obsolète
- Loading branch information
1 parent
2950b47
commit 272d845
Showing
19 changed files
with
691 additions
and
1,030 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -44,15 +44,28 @@ endif | |
--file $(DOCKERFILE) $(IMAGE) \ | ||
--cache-from=type=registry,ref=$(REGISTRY)$(IMAGE_NAME):$(VERSION)-$(VARIATION) | ||
|
||
build-local: ## Build the container | ||
$(eval DOCKERFILE := $(IMAGE)/Dockerfile-$(VERSION).$(VARIATION)) | ||
ifeq ("$(wildcard $(DOCKERFILE))","") | ||
$(eval DOCKERFILE := $(IMAGE)/Dockerfile.$(VARIATION)) | ||
endif | ||
docker buildx create --use | ||
docker buildx build \ | ||
--load \ | ||
--platform linux/amd64 \ | ||
--tag $(IMAGE_NAME):$(VERSION)-$(VARIATION) \ | ||
--build-arg PHP_VERSION=$(VERSION) \ | ||
--file $(DOCKERFILE) $(IMAGE) | ||
|
||
# Run containers | ||
run: stop ## Run container | ||
docker run -i -t --rm --name="$(IMAGE_NAME)" $(IMAGE_NAME) | ||
@docker run -i -t --rm --name="$(IMAGE_NAME)" $(IMAGE_NAME) | ||
|
||
stop: ## Stop running containers | ||
docker stop $(IMAGE_NAME) | ||
@docker stop $(IMAGE_NAME) | ||
|
||
rm: stop ## Stop and remove running containers | ||
docker rm $(IMAGE_NAME) | ||
@docker rm $(IMAGE_NAME) | ||
|
||
# Docker release - build, tag and push the container | ||
release: build-nc publish ## Make a release by building and publishing the tagged container | ||
|
@@ -65,4 +78,59 @@ publish: tag ## publish the taged container | |
# Docker tagging | ||
tag: ## Generate container tag | ||
@echo 'create tag $(VERSION)-$(VARIATION)' | ||
docker tag $(IMAGE_NAME) $(REGISTRY)$(IMAGE_NAME):$(VERSION)-$(VARIATION) | ||
docker tag $(IMAGE_NAME) $(REGISTRY)$(IMAGE_NAME):$(VERSION)-$(VARIATION) | ||
|
||
[email protected]: | ||
IMAGE=php VERSION=8.4 VARIATION=fpm $(MAKE) build-local | ||
|
||
[email protected]: | ||
IMAGE=php VERSION=8.2 VARIATION=caddy $(MAKE) build-local | ||
|
||
[email protected]: | ||
IMAGE=php VERSION=8.2 VARIATION=apache $(MAKE) build-local | ||
|
||
[email protected]: | ||
IMAGE=php VERSION=8.2 VARIATION=nginx $(MAKE) build-local | ||
|
||
[email protected]: | ||
IMAGE=php VERSION=8.2 VARIATION=frankenphp $(MAKE) build-local | ||
|
||
[email protected]: | ||
$(eval IMAGE := php) | ||
$(eval VERSION := 8.2) | ||
$(eval VARIATION := caddy) | ||
$(eval IMAGE_NAME := $(IMAGE_PREFIX)/$(IMAGE):$(VERSION)-$(VARIATION)) | ||
@docker stop $(IMAGE)_$(VERSION)-$(VARIATION) || true | ||
@docker run -i -t --rm -p 1234:80 -v ./test/:/var/www/html/ --name="$(IMAGE)_$(VERSION)-$(VARIATION)" $(IMAGE_NAME) | ||
|
||
[email protected]: | ||
$(eval IMAGE := php) | ||
$(eval VERSION := 8.2) | ||
$(eval VARIATION := apache) | ||
$(eval IMAGE_NAME := $(IMAGE_PREFIX)/$(IMAGE):$(VERSION)-$(VARIATION)) | ||
@docker stop $(IMAGE)_$(VERSION)-$(VARIATION) || true | ||
@docker run -i -t --rm -p 1234:80 -v ./test/:/var/www/html/ --name="$(IMAGE)_$(VERSION)-$(VARIATION)" $(IMAGE_NAME) | ||
|
||
[email protected]: | ||
$(eval IMAGE := php) | ||
$(eval VERSION := 8.2) | ||
$(eval VARIATION := nginx) | ||
$(eval IMAGE_NAME := $(IMAGE_PREFIX)/$(IMAGE):$(VERSION)-$(VARIATION)) | ||
@docker stop $(IMAGE)_$(VERSION)-$(VARIATION) || true | ||
@docker run -i -t --rm -p 1234:80 -v ./test/:/var/www/html/ --name="$(IMAGE)_$(VERSION)-$(VARIATION)" $(IMAGE_NAME) | ||
|
||
[email protected]: | ||
$(eval IMAGE := php) | ||
$(eval VERSION := 8.2) | ||
$(eval VARIATION := frankenphp) | ||
$(eval IMAGE_NAME := $(IMAGE_PREFIX)/$(IMAGE):$(VERSION)-$(VARIATION)) | ||
@docker stop $(IMAGE)_$(VERSION)-$(VARIATION) || true | ||
@docker run -i -t --rm -p 1234:80 -v ./test/:/var/www/html/ --name="$(IMAGE)_$(VERSION)-$(VARIATION)" $(IMAGE_NAME) | ||
|
||
[email protected]: | ||
$(eval IMAGE := php) | ||
$(eval VERSION := 8.2) | ||
$(eval VARIATION := frankenphp) | ||
$(eval IMAGE_NAME := $(IMAGE_PREFIX)/$(IMAGE):$(VERSION)-$(VARIATION)) | ||
@docker stop $(IMAGE)_$(VERSION)-$(VARIATION) || true | ||
@docker run -i -t --rm -p 1234:80 -v ./test/:/var/www/html/ -e FRANKENPHP_CONFIG="worker /var/www/html/index.php" -e FRANKENPHP_WORKER=true --name="$(IMAGE)_$(VERSION)-$(VARIATION)" $(IMAGE_NAME) |
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,94 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG PHP_VERSION | ||
FROM dunglas/frankenphp:php${PHP_VERSION} | ||
|
||
ENV COMPOSER_ALLOW_SUPERUSER='1' | ||
ENV COMPOSER_MEMORY_LIMIT='-1' | ||
ENV PHP_INI_MEMORY_LIMIT='-1' | ||
|
||
ENV PHP_INI_DATE_TIMEZONE='UTC' | ||
ENV PHP_INI_CGI_FIX_PATHINFO='0' | ||
|
||
ENV PHP_INI_UPLOAD_MAX_FILESIZE='16M' | ||
ENV PHP_INI_POST_MAX_SIZE='16M' | ||
|
||
ENV PHP_INI_ERROR_REPORTING='E_ALL & ~E_DEPRECATED & ~E_STRICT' | ||
ENV PHP_INI_DISPLAY_ERRORS='Off' | ||
ENV PHP_INI_DISPLAY_STARTUP_ERRORS='Off' | ||
|
||
ENV PHP_INI_REALPATH_CACHE_SIZE='4096k' | ||
ENV PHP_INI_REALPATH_CACHE_TTL='120' | ||
|
||
ENV PHP_INI_OPCACHE_MEMORY_CONSUMPTION='128' | ||
ENV PHP_INI_OPCACHE_INTERNED_STRINGS_BUFFER='8' | ||
ENV PHP_INI_OPCACHE_MAX_ACCELERATED_FILES='4000' | ||
ENV PHP_INI_OPCACHE_REVALIDATE_FREQ='60' | ||
ENV PHP_INI_OPCACHE_VALIDATE_TIMESTAMPS='1' | ||
ENV PHP_INI_OPCACHE_FAST_SHUTDOWN='1' | ||
ENV PHP_INI_OPCACHE_ENABLE_CLI='1' | ||
ENV PHP_INI_OPCACHE_ENABLE='1' | ||
ENV PHP_INI_OPCACHE_PRELOAD='' | ||
ENV PHP_INI_OPCACHE_PRELOAD_USER='' | ||
|
||
ENV PHP_INI_SOAP_WSDL_CACHE_ENABLED='1' | ||
|
||
ENV PHP_INI_MAX_EXECUTION_TIME='30' | ||
ENV PHP_INI_MAX_INPUT_TIME='60' | ||
|
||
ENV PHP_INI_SENDMAIL_PATH='sendmail -t -i' | ||
|
||
ENV XDEBUG_REMOTE_AUTOSTART='1' | ||
ENV XDEBUG_REMOTE_PORT='9003' | ||
ENV XDEBUG_START_WITH_REQUEST='trigger' | ||
ENV XDEBUG_MODE='off' | ||
|
||
RUN set -x \ | ||
&& apt-get update && apt-get install -y supervisor \ | ||
ca-certificates \ | ||
mime-support \ | ||
libnss3-tools \ | ||
imagemagick \ | ||
jpegoptim \ | ||
optipng \ | ||
webp \ | ||
pngquant \ | ||
ffmpeg \ | ||
libavif-dev \ | ||
mysql-client \ | ||
postgresql-client \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
ENV XDG_CONFIG_HOME="/config" | ||
ENV XDG_DATA_HOME="/data" | ||
|
||
ENV SERVER_NAME=":80" | ||
ENV DOCUMENT_ROOT="/var/www/html/" | ||
|
||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/install-php-extensions | ||
|
||
WORKDIR /var/www/html | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
EXPOSE 443/udp | ||
EXPOSE 2019 | ||
|
||
# Use the default production configuration | ||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
COPY config/php.ini /usr/local/etc/php/conf.d/000-php.ini | ||
|
||
RUN echo "expose_php = Off" > /usr/local/etc/php/conf.d/expose_php.ini | ||
|
||
# Install extensions | ||
RUN set -x \ | ||
install-php-extensions opcache intl gettext zip redis mysqli pgsql pdo_mysql pdo_pgsql gd exif xdebug pcntl | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
COPY config/frankenphp/Caddyfile /etc/caddy/ | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
CMD ["--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"] |
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,93 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG PHP_VERSION | ||
FROM dunglas/frankenphp:php${PHP_VERSION} | ||
|
||
ENV COMPOSER_ALLOW_SUPERUSER='1' | ||
ENV COMPOSER_MEMORY_LIMIT='-1' | ||
ENV PHP_INI_MEMORY_LIMIT='-1' | ||
|
||
ENV PHP_INI_DATE_TIMEZONE='UTC' | ||
ENV PHP_INI_CGI_FIX_PATHINFO='0' | ||
|
||
ENV PHP_INI_UPLOAD_MAX_FILESIZE='16M' | ||
ENV PHP_INI_POST_MAX_SIZE='16M' | ||
|
||
ENV PHP_INI_ERROR_REPORTING='E_ALL & ~E_DEPRECATED & ~E_STRICT' | ||
ENV PHP_INI_DISPLAY_ERRORS='Off' | ||
ENV PHP_INI_DISPLAY_STARTUP_ERRORS='Off' | ||
|
||
ENV PHP_INI_REALPATH_CACHE_SIZE='4096k' | ||
ENV PHP_INI_REALPATH_CACHE_TTL='120' | ||
|
||
ENV PHP_INI_OPCACHE_MEMORY_CONSUMPTION='128' | ||
ENV PHP_INI_OPCACHE_INTERNED_STRINGS_BUFFER='8' | ||
ENV PHP_INI_OPCACHE_MAX_ACCELERATED_FILES='4000' | ||
ENV PHP_INI_OPCACHE_REVALIDATE_FREQ='60' | ||
ENV PHP_INI_OPCACHE_VALIDATE_TIMESTAMPS='1' | ||
ENV PHP_INI_OPCACHE_FAST_SHUTDOWN='1' | ||
ENV PHP_INI_OPCACHE_ENABLE_CLI='1' | ||
ENV PHP_INI_OPCACHE_ENABLE='1' | ||
ENV PHP_INI_OPCACHE_PRELOAD='' | ||
ENV PHP_INI_OPCACHE_PRELOAD_USER='' | ||
|
||
ENV PHP_INI_SOAP_WSDL_CACHE_ENABLED='1' | ||
|
||
ENV PHP_INI_MAX_EXECUTION_TIME='30' | ||
ENV PHP_INI_MAX_INPUT_TIME='60' | ||
|
||
ENV PHP_INI_SENDMAIL_PATH='sendmail -t -i' | ||
|
||
ENV XDEBUG_REMOTE_AUTOSTART='1' | ||
ENV XDEBUG_REMOTE_PORT='9003' | ||
ENV XDEBUG_START_WITH_REQUEST='trigger' | ||
ENV XDEBUG_MODE='off' | ||
|
||
RUN set -x \ | ||
&& apt-get update && apt-get install -y supervisor \ | ||
ca-certificates \ | ||
mime-support \ | ||
libnss3-tools \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
ENV XDG_CONFIG_HOME="/config" | ||
ENV XDG_DATA_HOME="/data" | ||
|
||
ENV SERVER_NAME=":80" | ||
ENV DOCUMENT_ROOT="/var/www/html/" | ||
|
||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/install-php-extensions | ||
|
||
WORKDIR /var/www/html | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
EXPOSE 443/udp | ||
EXPOSE 2019 | ||
|
||
# Use the default production configuration | ||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
COPY config/php.ini /usr/local/etc/php/conf.d/000-php.ini | ||
|
||
RUN echo "expose_php = Off" > /usr/local/etc/php/conf.d/expose_php.ini | ||
|
||
# Install extensions | ||
RUN set -x \ | ||
install-php-extensions opcache intl gettext zip redis mysqli pgsql pdo_mysql pdo_pgsql gd exif xdebug pcntl | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
COPY config/frankenphp/Caddyfile /etc/caddy/ | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y \ | ||
wkhtmltopdf \ | ||
imagemagick \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
CMD ["--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"] |
Oops, something went wrong.