Skip to content

Commit

Permalink
Merge pull request #40 from linuxserver/standard-base
Browse files Browse the repository at this point in the history
Standard base
  • Loading branch information
nemchik authored Oct 19, 2022
2 parents 0980d3c + 74cad6e commit c143a48
Show file tree
Hide file tree
Showing 11 changed files with 222 additions and 150 deletions.
74 changes: 37 additions & 37 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,42 +8,42 @@ 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/ /
Expand Down
74 changes: 37 additions & 37 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,42 +8,42 @@ 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/ /
Expand Down
76 changes: 38 additions & 38 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,44 +8,44 @@ 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 local files
COPY root/ /

# ports and volumes
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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." }
Expand Down
2 changes: 1 addition & 1 deletion root/defaults/root → root/defaults/crontabs/root
Original file line number Diff line number Diff line change
Expand Up @@ -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 * * * * php /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1
22 changes: 0 additions & 22 deletions root/defaults/default

This file was deleted.

34 changes: 34 additions & 0 deletions root/defaults/nginx/site-confs/default.conf.sample
Original file line number Diff line number Diff line change
@@ -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 default_server;
listen [::]:443 ssl http2 default_server;

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$is_args$args;
}

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;
}
}
38 changes: 23 additions & 15 deletions root/etc/cont-init.d/40-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,44 @@

# 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
sed -i "s|/usr/bin/php[78] /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1|php /app/www/app/actualize_script.php > /tmp/FreshRSS.log 2>&1|" /config/crontabs/root
cp /config/crontabs/root /etc/crontabs/root

# permissions
chown -R abc:abc \
/usr/share/webapps/freshrss \
/config
/app/www \
/config
Loading

0 comments on commit c143a48

Please sign in to comment.