mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-21 17:15:25 +03:00
docker: Switch to nginx in docker image (#2721)
Co-authored-by: Yaman Qalieh <ybq987@gmail.com>
This commit is contained in:
parent
fcc3707210
commit
829fc6cca2
4 changed files with 34 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -229,6 +229,7 @@ pip-log.txt
|
|||
/whitelist.txt
|
||||
DEBUG
|
||||
config.ini.php
|
||||
config/*
|
||||
|
||||
######################
|
||||
## VisualStudioCode ##
|
||||
|
|
26
Dockerfile
26
Dockerfile
|
@ -1,24 +1,20 @@
|
|||
FROM php:7-apache-buster
|
||||
FROM php:7.4.29-fpm
|
||||
|
||||
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"
|
||||
|
||||
ENV APACHE_DOCUMENT_ROOT=/app
|
||||
RUN apt-get update && \
|
||||
apt-get install --yes --no-install-recommends \
|
||||
nginx \
|
||||
zlib1g-dev \
|
||||
libmemcached-dev && \
|
||||
pecl install memcached && \
|
||||
docker-php-ext-enable memcached && \
|
||||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
|
||||
&& apt-get --yes update \
|
||||
&& apt-get --yes --no-install-recommends install \
|
||||
zlib1g-dev \
|
||||
libmemcached-dev \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& pecl install memcached \
|
||||
&& docker-php-ext-enable memcached \
|
||||
&& sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
|
||||
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \
|
||||
&& sed -ri -e 's/(MinProtocol\s*=\s*)TLSv1\.2/\1None/' /etc/ssl/openssl.cnf \
|
||||
&& sed -ri -e 's/(CipherString\s*=\s*DEFAULT)@SECLEVEL=2/\1/' /etc/ssl/openssl.cnf
|
||||
COPY ./config/nginx.conf /etc/nginx/sites-enabled/default
|
||||
|
||||
COPY --chown=www-data:www-data ./ /app/
|
||||
|
||||
CMD ["/app/docker-entrypoint.sh"]
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
|
|
17
config/nginx.conf
Normal file
17
config/nginx.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
root /app;
|
||||
access_log /var/log/nginx/rssbridge.access.log;
|
||||
error_log /var/log/nginx/rssbridge.error.log;
|
||||
index index.php;
|
||||
|
||||
location ~ /(\.|vendor|tests) {
|
||||
deny all;
|
||||
return 403; # Forbidden
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
}
|
|
@ -32,9 +32,11 @@ done
|
|||
# If docker is run on network:service mode, no two containers can use port 80
|
||||
# To use this, start the container with the additional environment variable "HTTP_PORT"
|
||||
if [ ! -z ${HTTP_PORT} ]; then
|
||||
sed -i "s/80/$HTTP_PORT/g" /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
|
||||
sed -i "s/80/$HTTP_PORT/g" /etc/nginx/sites-enabled/default
|
||||
fi
|
||||
|
||||
# nginx will daemonize
|
||||
nginx
|
||||
|
||||
# Start apache
|
||||
apache2-foreground
|
||||
# php-fpm will not
|
||||
php-fpm
|
||||
|
|
Loading…
Reference in a new issue