-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Docker from Debian base image #3500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,47 @@ | ||
FROM lwthiker/curl-impersonate:0.5-ff-slim-buster AS curlimpersonate | ||
|
||
FROM php:8.0.27-fpm-buster AS rssbridge | ||
FROM debian:12-slim AS rssbridge | ||
|
||
LABEL description="RSS-Bridge is a PHP project capable of generating RSS and Atom feeds for websites that don't have one." | ||
LABEL repository="https://github.com/RSS-Bridge/rss-bridge" | ||
LABEL website="https://github.com/RSS-Bridge/rss-bridge" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && \ | ||
apt-get install --yes --no-install-recommends \ | ||
ca-certificates \ | ||
nginx \ | ||
zlib1g-dev \ | ||
libzip-dev \ | ||
libmemcached-dev \ | ||
nss-plugin-pem \ | ||
libicu-dev && \ | ||
docker-php-ext-install zip && \ | ||
docker-php-ext-install intl && \ | ||
pecl install memcached && \ | ||
docker-php-ext-enable memcached && \ | ||
docker-php-ext-enable opcache && \ | ||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
COPY ./config/nginx.conf /etc/nginx/sites-enabled/default | ||
|
||
COPY --chown=www-data:www-data ./ /app/ | ||
php-curl \ | ||
php-fpm \ | ||
php-intl \ | ||
# php-json is enabled by default with PHP 8.2 in Debian 12 | ||
php-mbstring \ | ||
php-memcached \ | ||
# php-opcache is enabled by default with PHP 8.2 in Debian 12 | ||
# php-openssl is enabled by default with PHP 8.2 in Debian 12 | ||
php-sqlite3 \ | ||
php-xml \ | ||
php-zip \ | ||
# php-zlib is enabled by default with PHP 8.2 in Debian 12 | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# logs should go to stdout / stderr | ||
RUN ln -sfT /dev/stderr /var/log/nginx/error.log; \ | ||
ln -sfT /dev/stdout /var/log/nginx/access.log; \ | ||
chown -R --no-dereference www-data:adm /var/log/nginx/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does nginx run as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those are the same rights than what nginx sets by default on the logs |
||
|
||
COPY --from=curlimpersonate /usr/local/lib/libcurl-impersonate-ff.so /usr/local/lib/curl-impersonate/ | ||
|
||
ENV LD_PRELOAD /usr/local/lib/curl-impersonate/libcurl-impersonate-ff.so | ||
|
||
ENV CURL_IMPERSONATE ff91esr | ||
|
||
COPY ./config/nginx.conf /etc/nginx/sites-available/default | ||
COPY ./config/php-fpm.conf /etc/php/8.2/fpm/pool.d/rss-bridge.conf | ||
COPY ./config/php.ini /etc/php/8.2/fpm/conf.d/90-rss-bridge.conf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in #3875 |
||
|
||
COPY --chown=www-data:www-data ./ /app/ | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["/app/docker-entrypoint.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ server { | |
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
root /app; | ||
access_log /dev/stdout; | ||
error_log /dev/stderr; | ||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
Comment on lines
+5
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using symlink to stdout / stderr instead, cf. Dockerfile |
||
index index.php; | ||
|
||
location ~ /(\.|vendor|tests) { | ||
|
@@ -13,6 +13,6 @@ server { | |
|
||
location ~ \.php$ { | ||
include snippets/fastcgi-php.conf; | ||
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using socket instead of TCP (should have less overhead) |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; Inspired by https://github.com/docker-library/php/blob/master/8.2/bookworm/fpm/Dockerfile | ||
|
||
[global] | ||
error_log = /proc/self/fd/2 | ||
|
||
; https://github.com/docker-library/php/pull/725#issuecomment-443540114 | ||
log_limit = 8192 | ||
|
||
[www] | ||
; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work. | ||
; https://bugs.php.net/bug.php?id=73886 | ||
access.log = /proc/self/fd/2 | ||
|
||
clear_env = no | ||
|
||
; Ensure worker stdout and stderr are sent to the main error log. | ||
catch_workers_output = yes | ||
decorate_workers_output = no |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
; Inspired by https://github.com/docker-library/php/blob/master/8.2/bookworm/fpm/Dockerfile | ||
|
||
; https://github.com/docker-library/php/issues/878#issuecomment-938595965' | ||
fastcgi.logging = Off |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inspired by https://github.com/docker-library/php/blob/3dc959846f1d44d6c3200f657dee762885847a2c/8.2/buster/apache/Dockerfile#L84-L87