Skip to content

Commit

Permalink
feat: 🎸 添加weserv
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Jul 1, 2024
1 parent cbb2683 commit 3974f4b
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 135 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-image-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
- kubectl
- radiance-bot
- nezha
- webserv
tag:
description: 'Image tag'

Expand Down
10 changes: 0 additions & 10 deletions emby/Dockerfile

This file was deleted.

Empty file removed emby/README.md
Empty file.
22 changes: 0 additions & 22 deletions emby/entrypoint.sh

This file was deleted.

55 changes: 0 additions & 55 deletions nginx-proxy-manager/Dockerfile

This file was deleted.

48 changes: 0 additions & 48 deletions nginx-proxy-manager/pagespeed.conf

This file was deleted.

87 changes: 87 additions & 0 deletions weserv/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
FROM rockylinux:9

LABEL [email protected]
LABEL VERSION=1.0.0

LABEL source_maintainer="Kleis Auke Wolthuizen <[email protected]>"

ARG NGINX_VERSION=1.27.0

WORKDIR /var/www/imagesweserv

RUN curl https://github.com/weserv/images/archive/refs/heads/5.x.zip -o images.zip && \
unzip images.zip && \
cp -a images-5.x/* /var/www/imagesweserv/ && \
rm -rf images.zip images-5.x

# Update packages
RUN dnf update -y \
# Install libvips and needed dependencies
&& dnf install -y epel-release \
&& crb enable \
&& dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm \
&& dnf config-manager --set-enabled remi \
&& dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm \
&& dnf group install -y --with-optional 'Development Tools' \
&& dnf install -y --setopt=tsflags=nodocs --setopt=install_weak_deps=False \
vips-devel \
vips-heif \
vips-poppler \
vips-magick-im6 \
jemalloc-devel \
openssl-devel \
pcre2-devel \
zlib-devel \
nginx-filesystem \
# Build CMake-based project
&& cmake -S . -B _build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TOOLS=ON \
-DNGX_VERSION=$NGINX_VERSION \
-DCUSTOM_NGX_FLAGS="--prefix=/usr/share/nginx;\
--sbin-path=/usr/sbin/nginx;\
--modules-path=/usr/lib64/nginx/modules;\
--conf-path=/etc/nginx/nginx.conf;\
--error-log-path=/var/log/nginx/error.log;\
--http-log-path=/var/log/nginx/access.log;\
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body;\
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy;\
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi;\
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi;\
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi;\
--pid-path=/run/nginx.pid;\
--lock-path=/run/lock/subsys/nginx;\
--user=nginx;\
--group=nginx" \
&& cmake --build _build -- -j$(nproc) \
&& ldconfig \
# Remove build directory and dependencies
&& rm -rf _build \
&& dnf group remove -y 'Development Tools' \
&& dnf remove -y \
vips-devel \
openssl-devel \
pcre2-devel \
zlib-devel \
&& dnf clean all \
# Ensure nginx directories exist with the correct permissions
&& mkdir -m 700 /var/lib/nginx \
&& mkdir -m 700 /var/lib/nginx/tmp \
&& mkdir -m 700 /usr/lib64/nginx \
&& mkdir -m 755 /usr/lib64/nginx/modules \
# Forward request and error logs to docker log collector
&& ln -sf /dev/stdout /var/log/nginx/weserv-access.log \
&& ln -sf /dev/stderr /var/log/nginx/weserv-error.log \
# Copy nginx configuration to the appropriate location
&& cp ngx_conf/*.conf /etc/nginx

# Set default timezone (can be overridden with -e "TZ=Continent/City")
ENV TZ=Asia/Shanghai \
# Use jemalloc on glibc-based Linux systems to reduce the effects of memory fragmentation
LD_PRELOAD=/usr/lib64/libjemalloc.so

EXPOSE 80

STOPSIGNAL SIGQUIT

CMD ["nginx", "-g", "daemon off;"]
5 changes: 5 additions & 0 deletions weserv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 介绍

在线图片处理,适配arm

来源:https://github.com/weserv/images

0 comments on commit 3974f4b

Please sign in to comment.