Merge pull request #6 from linuxserver/standard-base

Standard base
This commit is contained in:
Eric Nemchik 2022-08-22 08:09:19 -05:00 committed by GitHub
commit 9ede25c288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 132 additions and 59 deletions

View File

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15
# set version label
ARG BUILD_DATE
@ -19,7 +19,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
curl && \
echo "**** install snapdrop ****" && \
mkdir -p /app/snapdrop && \
mkdir -p /app/www && \
if [ -z ${SNAPDROP_RELEASE} ]; then \
SNAPDROP_RELEASE=$(curl -sX GET "https://api.github.com/repos/RobinLinus/snapdrop/commits/master" \
| awk '/sha/{print $4;exit}' FS='[""]'); \
@ -29,8 +29,8 @@ RUN \
"https://github.com/RobinLinus/snapdrop/archive/${SNAPDROP_RELEASE}.tar.gz" && \
tar xf \
/tmp/snapdrop.tar.gz -C \
/app/snapdrop/ --strip-components=1 && \
cd /app/snapdrop/server && \
/app/www/ --strip-components=1 && \
cd /app/www/server && \
npm i && \
echo "**** cleanup ****" && \
apk del --purge \
@ -41,3 +41,7 @@ RUN \
# 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.14
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15
# set version label
ARG BUILD_DATE
@ -19,7 +19,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
curl && \
echo "**** install snapdrop ****" && \
mkdir -p /app/snapdrop && \
mkdir -p /app/www && \
if [ -z ${SNAPDROP_RELEASE} ]; then \
SNAPDROP_RELEASE=$(curl -sX GET "https://api.github.com/repos/RobinLinus/snapdrop/commits/master" \
| awk '/sha/{print $4;exit}' FS='[""]'); \
@ -29,8 +29,8 @@ RUN \
"https://github.com/RobinLinus/snapdrop/archive/${SNAPDROP_RELEASE}.tar.gz" && \
tar xf \
/tmp/snapdrop.tar.gz -C \
/app/snapdrop/ --strip-components=1 && \
cd /app/snapdrop/server && \
/app/www/ --strip-components=1 && \
cd /app/www/server && \
npm i && \
echo "**** cleanup ****" && \
apk del --purge \
@ -41,3 +41,7 @@ RUN \
# 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.14
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15
# set version label
ARG BUILD_DATE
@ -19,7 +19,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
curl && \
echo "**** install snapdrop ****" && \
mkdir -p /app/snapdrop && \
mkdir -p /app/www && \
if [ -z ${SNAPDROP_RELEASE} ]; then \
SNAPDROP_RELEASE=$(curl -sX GET "https://api.github.com/repos/RobinLinus/snapdrop/commits/master" \
| awk '/sha/{print $4;exit}' FS='[""]'); \
@ -29,8 +29,8 @@ RUN \
"https://github.com/RobinLinus/snapdrop/archive/${SNAPDROP_RELEASE}.tar.gz" && \
tar xf \
/tmp/snapdrop.tar.gz -C \
/app/snapdrop/ --strip-components=1 && \
cd /app/snapdrop/server && \
/app/www/ --strip-components=1 && \
cd /app/www/server && \
npm i && \
echo "**** cleanup ****" && \
apk del --purge \
@ -41,3 +41,7 @@ RUN \
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config

View File

@ -62,7 +62,7 @@ The architectures supported by this image are:
Webui is accessible at http://SERVERIP:PORT
If you intend to expose Snapdrop to the internet, edit /config/nginx/site-confs/default and uncomment the real_ip settings
If you intend to expose Snapdrop to the internet, edit /config/nginx/site-confs/default.conf and uncomment the real_ip settings
## Usage
@ -226,5 +226,6 @@ 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)).
* **09.08.21:** - Rebase to Alpine 3.14. Add real_ip block to nginx default site config.
* **15.09.20:** - Initial Release.

View File

@ -1,13 +1,13 @@
alpine-baselayout-3.2.0-r16
alpine-keys-2.4-r0
apache2-utils-2.4.54-r0
apache2-utils-2.4.51-r0
apk-tools-2.12.7-r0
apr-1.7.0-r1
apr-util-1.6.1-r7
argon2-libs-20190702-r1
bash-5.1.16-r0
brotli-libs-1.0.9-r5
busybox-1.33.1-r8
busybox-1.33.1-r6
c-ares-1.17.2-r0
ca-certificates-20220614-r0
ca-certificates-bundle-20220614-r0
@ -30,8 +30,8 @@ libressl3.3-libssl-3.3.6-r0
libretls-3.3.3p1-r3
libssl1.1-1.1.1q-r0
libstdc++-10.3.1_git20210424-r2
libuuid-2.37.4-r0
libxml2-2.9.14-r0
libuuid-2.37.2-r0
libxml2-2.9.12-r1
linux-pam-1.5.1-r1
logrotate-3.18.1-r3
musl-1.2.2-r3
@ -40,13 +40,13 @@ nano-5.7-r2
ncurses-libs-6.2_p20210612-r1
ncurses-terminfo-base-6.2_p20210612-r1
nghttp2-libs-1.43.0-r0
nginx-1.20.2-r1
nodejs-14.20.0-r0
nginx-1.20.2-r0
nodejs-14.18.1-r0
npm-7.17.0-r0
oniguruma-6.9.7.1-r0
openssl-1.1.1q-r0
pcre-8.44-r0
pcre2-10.36-r1
pcre2-10.36-r0
php7-7.4.26-r0
php7-common-7.4.26-r0
php7-fileinfo-7.4.26-r0
@ -65,8 +65,8 @@ s6-ipcserver-2.10.0.3-r0
scanelf-1.3.2-r0
shadow-4.8.1-r0
skalibs-2.10.0.3-r0
ssl_client-1.33.1-r8
tzdata-2022a-r0
ssl_client-1.33.1-r6
tzdata-2021e-r0
utmps-0.1.0.2-r0
xz-5.2.5-r1
xz-libs-5.2.5-r1

View File

@ -63,9 +63,10 @@ app_setup_block_enabled: true
app_setup_block: |
Webui is accessible at http://SERVERIP:PORT
If you intend to expose Snapdrop to the internet, edit /config/nginx/site-confs/default and uncomment the real_ip settings
If you intend to expose Snapdrop to the internet, edit /config/nginx/site-confs/default.conf and uncomment the real_ip settings
# 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: "09.08.21:", desc: "Rebase to Alpine 3.14. Add real_ip block to nginx default site config." }
- { date: "15.09.20:", desc: "Initial Release." }

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>

View File

@ -1,33 +0,0 @@
server {
listen 80 default_server;
listen 443 ssl;
root /app/snapdrop/client;
index index.php index.html index.htm;
server_name _;
ssl_certificate /config/keys/cert.crt;
ssl_certificate_key /config/keys/cert.key;
client_max_body_size 0;
# Uncomment the block below and update the "set_real_ip" with the address/range of your reverse proxy if you intend to expose Snapdrop to the internet
#set_real_ip_from 127.0.0.1/32;
#real_ip_header X-Forwarded-For;
#real_ip_recursive on;
location / {
root /app/snapdrop/client;
index index.html index.htm;
}
location /server {
proxy_connect_timeout 300;
proxy_pass http://localhost:3000;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}
}

View File

@ -0,0 +1,42 @@
## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-snapdrop/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/client;
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.html /index.php?$args =404;
}
location /server {
proxy_connect_timeout 300;
proxy_pass http://localhost:3000;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}
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,4 +2,4 @@
# permissions
chown -R abc:abc \
/config
/config

View File

@ -1,6 +1,6 @@
#!/usr/bin/with-contenv bash
cd /app/snapdrop/server || exit
cd /app/www/server || exit 1
exec \
s6-setuidgid abc /usr/bin/node index.js
s6-setuidgid abc /usr/bin/node index.js

View File

@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bash
DEFAULT_CONF="/config/nginx/site-confs/default.conf"
OLD_ROOT="root /app/snapdrop/client;"
NEW_ROOT="root /app/www/client;"
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then
echo "updating root in ${DEFAULT_CONF}"
sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}"
fi