Move to alpine, more streamlined php extension installation
This commit is contained in:
parent
17b290bb3c
commit
7151ceadc3
@ -2,13 +2,10 @@
|
|||||||
|
|
||||||
# Before running this, you need to install binfmt_misc support and create a builder:
|
# Before running this, you need to install binfmt_misc support and create a builder:
|
||||||
# docker run --privileged --rm tonistiigi/binfmt --install all
|
# docker run --privileged --rm tonistiigi/binfmt --install all
|
||||||
# export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
# docker buildx create --use --name mybuilder
|
# docker buildx create --use --name mybuilder
|
||||||
# https://github.com/docker/buildx
|
# https://github.com/docker/buildx
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
-t namelessmc/nginx:v2-pr7 \
|
-t namelessmc/nginx:v2-pr7 \
|
||||||
-t namelessmc/nginx:v2-pr8 \
|
-t namelessmc/nginx:v2-pr8 \
|
||||||
|
|||||||
@ -1,24 +1,24 @@
|
|||||||
ARG PHP_VERSION=7.4
|
ARG PHP_VERSION=7.4
|
||||||
FROM php:${PHP_VERSION}-fpm
|
FROM php:${PHP_VERSION}-fpm-alpine
|
||||||
|
|
||||||
RUN BUILD_DEPS="libmcrypt-dev libldap2-dev" && \
|
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||||
RUNTIME_DEPS="libjpeg62-turbo-dev libfreetype6-dev libpng-dev libfreetype6-dev libzip-dev curl tar sendmail" && \
|
RUN chmod +x /usr/local/bin/install-php-extensions && \
|
||||||
apt-get update && \
|
install-php-extensions gd pdo_mysql mysqli zip exif
|
||||||
apt-get install -y --no-install-recommends $BUILD_DEPS $RUNTIME_DEPS && \
|
|
||||||
docker-php-ext-configure gd --with-freetype --with-jpeg && \
|
# Set www-data user and group to id 33 which is standard in Debian
|
||||||
docker-php-ext-install -j "$(nproc)" exif gd pdo_mysql mysqli zip && \
|
RUN deluser xfs && \
|
||||||
apt-get purge -y $BUILD_DEPS && \
|
apk add --no-cache shadow && \
|
||||||
apt-get autoremove --purge -y && \
|
usermod -u 33 www-data && \
|
||||||
rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/*
|
groupmod -g 33 www-data && \
|
||||||
|
apk del shadow
|
||||||
|
|
||||||
RUN { \
|
RUN { \
|
||||||
echo "upload_max_filesize = 512M"; \
|
echo "upload_max_filesize = 512M"; \
|
||||||
echo "post_max_size = 512M"; \
|
echo "post_max_size = 512M"; \
|
||||||
echo "max_input_time = 300"; \
|
echo "max_input_time = 300"; \
|
||||||
echo "max_execution_time = 300"; \
|
echo "max_execution_time = 300"; \
|
||||||
} > /usr/local/etc/php/conf.d/nameless.ini
|
} > /usr/local/etc/php/conf.d/nameless.ini && \
|
||||||
|
{ \
|
||||||
RUN { \
|
|
||||||
echo "[www]"; \
|
echo "[www]"; \
|
||||||
echo "pm.max_children = 32"; \
|
echo "pm.max_children = 32"; \
|
||||||
echo "pm.start_servers = 1"; \
|
echo "pm.start_servers = 1"; \
|
||||||
@ -28,7 +28,7 @@ RUN { \
|
|||||||
|
|
||||||
ADD entrypoint.sh /
|
ADD entrypoint.sh /
|
||||||
|
|
||||||
ARG VERSION=v2.0.0-pr10
|
ARG VERSION=v2.0.0-pr12
|
||||||
ENV VERSION=${VERSION}
|
ENV VERSION=${VERSION}
|
||||||
|
|
||||||
# Used by website to know if it runs using our docker images for statistics
|
# Used by website to know if it runs using our docker images for statistics
|
||||||
@ -40,4 +40,4 @@ ENV NAMELESS_PATH_HIDE=true
|
|||||||
# Enable friendly URLs and hide the option by default, they work fine with the included configuration and there is no reason to turn it off.
|
# Enable friendly URLs and hide the option by default, they work fine with the included configuration and there is no reason to turn it off.
|
||||||
ENV NAMELESS_FRIENDLY_URLS=true NAMELESS_FRIENDLY_URLS_HIDE=true
|
ENV NAMELESS_FRIENDLY_URLS=true NAMELESS_FRIENDLY_URLS_HIDE=true
|
||||||
|
|
||||||
ENTRYPOINT [ "bash", "/entrypoint.sh" ]
|
ENTRYPOINT [ "sh", "/entrypoint.sh" ]
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -n "$(ls -A /data 2>/dev/null)" ]
|
if [ -n "$(ls -A /data 2>/dev/null)" ]
|
||||||
@ -11,14 +11,11 @@ else
|
|||||||
cd /tmp
|
cd /tmp
|
||||||
curl -Lo "nameless.tar.gz" "https://github.com/NamelessMC/Nameless/archive/${VERSION}.tar.gz"
|
curl -Lo "nameless.tar.gz" "https://github.com/NamelessMC/Nameless/archive/${VERSION}.tar.gz"
|
||||||
tar -xf "nameless.tar.gz"
|
tar -xf "nameless.tar.gz"
|
||||||
mv Nameless-*/{,.[^.]}* "/data"
|
mv Nameless-*/* "/data"
|
||||||
rm -rf /tmp/*
|
rm -rf /tmp/*
|
||||||
# remove some unnecessary files
|
# remove some unnecessary files (dotfiles in the root directory are not copied in the first place)
|
||||||
cd /data
|
cd /data
|
||||||
rm -rf \
|
rm -rf \
|
||||||
.gitignore \
|
|
||||||
.github \
|
|
||||||
.htaccess \
|
|
||||||
cache/.htaccess \
|
cache/.htaccess \
|
||||||
changelog.txt \
|
changelog.txt \
|
||||||
CONTRIBUTORS.md \
|
CONTRIBUTORS.md \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user