Skip to content

Commit

Permalink
Use standard nginx.conf from lsio alpine nginx base image
Browse files Browse the repository at this point in the history
  • Loading branch information
nemchik committed Aug 20, 2022
1 parent 8de077d commit 1d22244
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 144 deletions.
24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15-php8
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15

# set version label
ARG BUILD_DATE
Expand All @@ -10,8 +10,7 @@ LABEL maintainer="hackerman"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer \
git && \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
Expand All @@ -25,18 +24,22 @@ RUN \
php8-dom \
php8-exif \
php8-gd \
php8-pecl-imagick \
php8-intl \
php8-json \
php8-mbstring \
php8-mysqli \
php8-pdo_mysql \
php8-pecl-imagick \
php8-phar \
php8-session \
php8-tokenizer \
php8-xml \
php8-zip && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \
echo "**** install lychee ****" && \
mkdir -p /app/lychee && \
mkdir -p /app/www && \
if [ -z ${LYCHEE_VERSION} ]; then \
LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
Expand All @@ -45,12 +48,12 @@ RUN \
/tmp/lychee.tar.gz -L \
"https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \
tar xf \
/tmp/lychee.tar.gz -C \
/app/lychee/ --strip-components=1 && \
cd /app/lychee && \
/tmp/lychee.tar.gz -C \
/app/www/ --strip-components=1 && \
cd /app/www && \
echo "**** install composer dependencies ****" && \
composer install \
-d /app/lychee \
-d /app/www \
--no-dev \
--no-suggest \
--no-interaction && \
Expand All @@ -64,3 +67,6 @@ RUN \

# add local files
COPY root/ /

# ports and volumes
EXPOSE 80 443
22 changes: 13 additions & 9 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15-php8
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15

# set version label
ARG BUILD_DATE
Expand All @@ -10,8 +10,7 @@ LABEL maintainer="hackerman"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer \
git && \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
Expand All @@ -25,18 +24,22 @@ RUN \
php8-dom \
php8-exif \
php8-gd \
php8-pecl-imagick \
php8-intl \
php8-json \
php8-mbstring \
php8-mysqli \
php8-pdo_mysql \
php8-pecl-imagick \
php8-phar \
php8-session \
php8-tokenizer \
php8-xml \
php8-zip && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \
echo "**** install lychee ****" && \
mkdir -p /app/lychee && \
mkdir -p /app/www && \
if [ -z ${LYCHEE_VERSION} ]; then \
LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
Expand All @@ -45,12 +48,12 @@ RUN \
/tmp/lychee.tar.gz -L \
"https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \
tar xf \
/tmp/lychee.tar.gz -C \
/app/lychee/ --strip-components=1 && \
cd /app/lychee && \
/tmp/lychee.tar.gz -C \
/app/www/ --strip-components=1 && \
cd /app/www && \
echo "**** install composer dependencies ****" && \
composer install \
-d /app/lychee \
-d /app/www \
--no-dev \
--no-suggest \
--no-interaction && \
Expand All @@ -59,6 +62,7 @@ RUN \
build-dependencies && \
rm -rf \
/root/.cache \
/root/.composer \
/tmp/*

# add local files
Expand Down
22 changes: 13 additions & 9 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15-php8
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15

# set version label
ARG BUILD_DATE
Expand All @@ -10,8 +10,7 @@ LABEL maintainer="hackerman"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer \
git && \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
Expand All @@ -25,18 +24,22 @@ RUN \
php8-dom \
php8-exif \
php8-gd \
php8-pecl-imagick \
php8-intl \
php8-json \
php8-mbstring \
php8-mysqli \
php8-pdo_mysql \
php8-pecl-imagick \
php8-phar \
php8-session \
php8-tokenizer \
php8-xml \
php8-zip && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php8/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php8/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php8/php-fpm.d/www.conf && \
echo "**** install lychee ****" && \
mkdir -p /app/lychee && \
mkdir -p /app/www && \
if [ -z ${LYCHEE_VERSION} ]; then \
LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
Expand All @@ -45,12 +48,12 @@ RUN \
/tmp/lychee.tar.gz -L \
"https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \
tar xf \
/tmp/lychee.tar.gz -C \
/app/lychee/ --strip-components=1 && \
cd /app/lychee && \
/tmp/lychee.tar.gz -C \
/app/www/ --strip-components=1 && \
cd /app/www && \
echo "**** install composer dependencies ****" && \
composer install \
-d /app/lychee \
-d /app/www \
--no-dev \
--no-suggest \
--no-interaction && \
Expand All @@ -59,6 +62,7 @@ RUN \
build-dependencies && \
rm -rf \
/root/.cache \
/root/.composer \
/tmp/*

# add local files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **04.12.21:** - Rebase to alpine 3.15 with php8.
* **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)).
* **13.05.21:** - Make readme clearer.
* **18.04.21:** - Add php-intl for v4.3.
* **31.01.21:** - Add jpegoptim.
Expand Down
Loading

0 comments on commit 1d22244

Please sign in to comment.