Use standard nginx.conf from lsio alpine nginx base image

This commit is contained in:
Eric Nemchik
2021-10-14 16:03:35 -05:00
parent 7c5f4dac13
commit 34f61f605c
10 changed files with 210 additions and 152 deletions

View File

@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.13
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15
# set version label
ARG BUILD_DATE
@@ -8,46 +8,45 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="aptalca"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
php7-ctype \
php7-curl \
php7-dom \
php7-gmp \
php7-iconv \
php7-intl \
php7-mysqli \
php7-mysqlnd \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-pgsql \
php7-sqlite3 \
php7-zip \
sqlite && \
echo "**** install app ****" && \
if [ -z ${FRESHRSS_RELEASE+x} ]; then \
FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/usr/share/webapps/freshrss && \
curl -o \
/tmp/freshrss.tar.gz -L \
"https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \
tar xf \
/tmp/freshrss.tar.gz -C \
/usr/share/webapps/freshrss --strip-components=1 && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \
/usr/share/webapps/freshrss/config.default.php && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
php8-ctype \
php8-curl \
php8-dom \
php8-gmp \
php8-iconv \
php8-intl \
php8-mysqli \
php8-mysqlnd \
php8-pdo_mysql \
php8-pdo_pgsql \
php8-pdo_sqlite \
php8-pgsql \
php8-sqlite3 \
php8-zip \
sqlite && \
echo "**** install app ****" && \
if [ -z ${FRESHRSS_RELEASE+x} ]; then \
FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/app/www && \
curl -o \
/tmp/freshrss.tar.gz -L \
"https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \
tar xf \
/tmp/freshrss.tar.gz -C \
/app/www --strip-components=1 && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \
/app/www/config.default.php && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config

View File

@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.13
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15
# set version label
ARG BUILD_DATE
@@ -8,46 +8,45 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="aptalca"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
php7-ctype \
php7-curl \
php7-dom \
php7-gmp \
php7-iconv \
php7-intl \
php7-mysqli \
php7-mysqlnd \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-pgsql \
php7-sqlite3 \
php7-zip \
sqlite && \
echo "**** install app ****" && \
if [ -z ${FRESHRSS_RELEASE+x} ]; then \
FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/usr/share/webapps/freshrss && \
curl -o \
/tmp/freshrss.tar.gz -L \
"https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \
tar xf \
/tmp/freshrss.tar.gz -C \
/usr/share/webapps/freshrss --strip-components=1 && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \
/usr/share/webapps/freshrss/config.default.php && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
php8-ctype \
php8-curl \
php8-dom \
php8-gmp \
php8-iconv \
php8-intl \
php8-mysqli \
php8-mysqlnd \
php8-pdo_mysql \
php8-pdo_pgsql \
php8-pdo_sqlite \
php8-pgsql \
php8-sqlite3 \
php8-zip \
sqlite && \
echo "**** install app ****" && \
if [ -z ${FRESHRSS_RELEASE+x} ]; then \
FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/app/www && \
curl -o \
/tmp/freshrss.tar.gz -L \
"https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \
tar xf \
/tmp/freshrss.tar.gz -C \
/app/www --strip-components=1 && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \
/app/www/config.default.php && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config

View File

@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.13
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15
# set version label
ARG BUILD_DATE
@@ -8,46 +8,45 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="aptalca"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
php7-ctype \
php7-curl \
php7-dom \
php7-gmp \
php7-iconv \
php7-intl \
php7-mysqli \
php7-mysqlnd \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-pgsql \
php7-sqlite3 \
php7-zip \
sqlite && \
echo "**** install app ****" && \
if [ -z ${FRESHRSS_RELEASE+x} ]; then \
FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/usr/share/webapps/freshrss && \
curl -o \
/tmp/freshrss.tar.gz -L \
"https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \
tar xf \
/tmp/freshrss.tar.gz -C \
/usr/share/webapps/freshrss --strip-components=1 && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \
/usr/share/webapps/freshrss/config.default.php && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
php8-ctype \
php8-curl \
php8-dom \
php8-gmp \
php8-iconv \
php8-intl \
php8-mysqli \
php8-mysqlnd \
php8-pdo_mysql \
php8-pdo_pgsql \
php8-pdo_sqlite \
php8-pgsql \
php8-sqlite3 \
php8-zip \
sqlite && \
echo "**** install app ****" && \
if [ -z ${FRESHRSS_RELEASE+x} ]; then \
FRESHRSS_RELEASE=$(curl -sX GET "https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p \
/app/www && \
curl -o \
/tmp/freshrss.tar.gz -L \
"https://github.com/FreshRSS/FreshRSS/archive/${FRESHRSS_RELEASE}.tar.gz" && \
tar xf \
/tmp/freshrss.tar.gz -C \
/app/www --strip-components=1 && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" \
/app/www/config.default.php && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config

View File

@@ -225,6 +225,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)).
* **23.01.21:** - Rebasing to alpine 3.13.
* **01.06.20:** - Rebasing to alpine 3.12.
* **31.03.20:** - Internalize app and enable updates for existing users, allow user customized crontab.

View File

@@ -52,6 +52,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." }
- { date: "23.01.21:", desc: "Rebasing to alpine 3.13." }
- { date: "01.06.20:", desc: "Rebasing to alpine 3.12." }
- { date: "31.03.20:", desc: "Internalize app and enable updates for existing users, allow user customized crontab." }

View File

@@ -6,4 +6,4 @@
0 3 * * 6 run-parts /etc/periodic/weekly
0 5 1 * * run-parts /etc/periodic/monthly
# freshrss cronjob
*/15 * * * * /usr/bin/php7 /usr/share/webapps/freshrss/app/actualize_script.php > /tmp/FreshRSS.log 2>&1
*/15 * * * * /usr/bin/php8 /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1

View File

@@ -1,22 +0,0 @@
server {
listen 80;
listen 443 ssl;
index index.html index.htm index.php;
server_name _;
ssl_certificate /config/keys/cert.crt;
ssl_certificate_key /config/keys/cert.key;
client_max_body_size 0;
root /usr/share/webapps/freshrss/p;
index index.php index.html index.htm;
location ~ ^.+?\.php(/.*)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location / {
try_files $uri $uri/ index.php;
}
}

View File

@@ -0,0 +1,34 @@
## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-freshrss/commits/master/root/defaults/nginx/site-confs/default.conf.sample
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name _;
root /app/www/p;
index index.html index.htm index.php;
location / {
# enable for basic auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
# deny access to .htaccess/.htpasswd files
location ~ /\.ht {
deny all;
}
}

View File

@@ -2,36 +2,43 @@
# make our folders
mkdir -p \
/config/{crontabs,www/freshrss}
/config/{crontabs,www/freshrss}
# create symlinks
symlinks=( \
/usr/share/webapps/freshrss/data \
/usr/share/webapps/freshrss/extensions )
/app/www/data \
/app/www/extensions )
for i in "${symlinks[@]}"
do
[[ -e "$i" && ! -L "$i" ]] && mv "$i" "${i}.bak"
[[ ! -L "$i" ]] && ln -s "/config/www/freshrss/$(basename "$i")" "$i"
[[ ! -d "/config/www/freshrss/$(basename "$i")" ]] && \
cp -R "${i}.bak" "/config/www/freshrss/$(basename "$i")"
if [[ -e "$i" && ! -L "$i" ]]; then
mv "$i" "${i}.bak"
fi
if [[ ! -L "$i" ]]; then
ln -s "/config/www/freshrss/$(basename "$i")" "$i"
fi
if [[ ! -d "/config/www/freshrss/$(basename "$i")" ]]; then
cp -R "${i}.bak" "/config/www/freshrss/$(basename "$i")"
fi
done
# backwards compatibility
if grep -q 'root /config/www/freshrss/p;' /config/nginx/site-confs/default; then
cp /defaults/default /config/nginx/site-confs/default
if grep -q 'root /config/www/freshrss/p;' /config/nginx/site-confs/default.conf; then
cp /defaults/nginx/site-confs/default.conf.sample /config/nginx/site-confs/default.conf
fi
# disable updates
[[ -f /config/www/freshrss/data/config.php ]] && \
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" /config/www/freshrss/data/config.php
if [[ -f /config/www/freshrss/data/config.php ]]; then
sed -i "s|'disable_update' => false,|'disable_update' => true,|g" /config/www/freshrss/data/config.php
fi
# set cronjob
[[ ! -f /config/crontabs/root ]] && \
cp /defaults/root /config/crontabs/root
if [[ ! -f /config/crontabs/root ]]; then
cp /defaults/crontabs/root /config/crontabs/root
fi
cp /config/crontabs/root /etc/crontabs/root
# permissions
chown -R abc:abc \
/usr/share/webapps/freshrss \
/config
/app/www \
/config

View File

@@ -0,0 +1,40 @@
<html>
<head>
<title>Upgrade Required!</title>
<style>
body{
font-family: Helvetica, Arial, sans-serif;
}
.message{
width:440px;
padding:20px 40px;
margin:0 auto;
background-color:#f9f9f9;
border:1px solid #ddd;
color: #1e3d62;
}
center{
margin:40px 0;
}
h1{
font-size: 18px;
line-height: 26px;
}
p{
font-size: 12px;
}
a{
color: rgb(207, 48, 139);
}
</style>
</head>
<body>
<div class="message">
<h1>Upgrade Required!</h1>
<p>The application inside this image has been moved to a new folder.</p>
<p>You will need to update your <strong>/config/nginx/nginx.conf</strong> and <strong>/config/nginx/site-confs/default.conf</strong> in order for the application to work.</p>
<p>New config samples are located at <strong>/config/nginx/nginx.conf.sample</strong> and <strong>/config/nginx/site-confs/default.conf.sample</strong></p>
<p>Please review our announcement: <a target="_blank" href="https://info.linuxserver.io/issues/2022-08-20-nginx-base/">Significant changes to nginx based images</a></p>
</div>
</body>
</html>