You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/Dockerfile

145 lines
3.2 KiB
Docker

FROM serversideup/php:8.5-frankenphp AS ffmpeg
# ffmpeg version to compile, change with [--build-arg FFMPEG_VERSION="9.0.1"]
ARG FFMPEG_VERSION=9.0.1
ARG FFMPEG_URL=https://ffmpeg.org/releases
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
cmake \
git \
libtool \
meson \
nasm \
ninja-build \
pkg-config \
wget \
xz-utils \
yasm \
libaom-dev \
libdav1d-dev \
libmp3lame-dev \
libnuma-dev \
libopus-dev \
libvorbis-dev \
libvpx-dev \
libwebp-dev \
libx264-dev \
libx265-dev \
zlib1g-dev \
liblzma-dev \
libbz2-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/local/ffmpeg/src
ADD ${FFMPEG_URL}/ffmpeg-${FFMPEG_VERSION}.tar.xz /usr/local/ffmpeg/src/
RUN tar xf ffmpeg-${FFMPEG_VERSION}.tar.xz
WORKDIR /usr/local/ffmpeg/src/ffmpeg-${FFMPEG_VERSION}
# --toolchain=hardened : compiler hardening (stack protector, FORTIFY, RELRO)
# for a tool that parses untrusted user-uploaded media.
# --enable-lto : link-time optimization for a small runtime speedup.
RUN ./configure \
--prefix=/usr/local/ffmpeg \
--toolchain=hardened \
--enable-lto \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-static \
--enable-shared \
--enable-ffmpeg \
--enable-ffprobe \
--enable-gpl \
--enable-version3 \
--enable-pthreads \
--enable-libaom \
--enable-libdav1d \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-zlib \
--enable-lzma \
; \
make -j"$(nproc)"; \
make install
# PHP base image — FrankenPHP (includes Caddy built-in)
FROM serversideup/php:8.5-frankenphp
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
WORKDIR /var/www/html
USER root
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
RUN apt-get update && apt-get install -y \
unzip \
zip \
jpegoptim \
optipng \
pngquant \
gifsicle \
libvips42 \
git \
curl \
libaom-dev \
libdav1d-dev \
libmp3lame0 \
libnuma1 \
libopus0 \
libvorbis0a \
libvorbisenc2 \
libvpx-dev \
libwebp7 \
libwebpmux3 \
libx264-dev \
libx265-dev \
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
&& rm -rf /var/lib/apt/lists/*
RUN install-php-extensions \
bcmath \
curl \
exif \
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
gd \
10 months ago
imagick \
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
intl \
mbstring \
xml \
zip \
pdo_mysql \
redis \
vips \
ffi
COPY --from=ffmpeg /usr/local/ffmpeg/bin/ffmpeg /usr/bin/ffmpeg
COPY --from=ffmpeg /usr/local/ffmpeg/bin/ffprobe /usr/bin/ffprobe
COPY --from=ffmpeg /usr/local/ffmpeg/lib /usr/local/lib
RUN ldconfig \
&& /usr/bin/ffmpeg -version \
&& /usr/bin/ffprobe -version
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
COPY --chown=www-data:www-data . /var/www/html
RUN chown -R www-data:www-data /var/www/html \
&& find /var/www/html -type f -exec chmod 644 {} \; \
&& find /var/www/html -type d -exec chmod 755 {} \; \
&& chmod -R ug+rwx /var/www/html/storage /var/www/html/bootstrap/cache
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
RUN composer install --no-ansi --no-interaction --optimize-autoloader
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
USER www-data
Staging (#6343) * Prepared new docker * Docker setup improvements and fixes * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update DOCKER_SETUP.md * Update .dockerignore * DB/Redis health check * updated health checks * updated install guide * updated DOCKER_SETUP * Updated DOCKER_SETUP * Updated DOCKER_SETUP * Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md * RemoveUnreachableStatementRector * Update GroupActivityPubService.php * Larastan: Add @property * Delete rector.php * more properties * 2fa_enabled needs to be refactored * Fix AdminUser.php syntax error - remove invalid property declaration * Update AdminUser.php * update * Upgrade predis from v2.0 to v3.2 - Update predis/predis from ^2.0 to ^3.2 - Predis v3.2.0 includes RESP3 support, improved pipeline abstractions - No code changes required, configuration remains compatible - Tested successfully with tinker * Upgrade predis from v2.0 to v3.2 * Update * Update .env.docker.example * Update DOCKER_COMPOSE_SETUP.md * Create ImageDriverManager.php * Update image.php * Update ImageResizePipeline.php * Update StoryComposeController.php * Update AvatarOptimize.php * Update Image.php * Update composer.json * Update AvatarOptimize.php * update lock * Update composer.lock * update * update * update * Allow to set new image types in admin interface * Update composer, fix deps * Update composer --------- Co-authored-by: Shlee <github@shl.ee> Co-authored-by: Your Name <you@example.com> Co-authored-by: Severin <savewish@icloud.com>
10 months ago
EXPOSE 8080
4 months ago
EXPOSE 8443