mirror of
https://github.com/gilbN/theme.park.git
synced 2024-11-20 01:52:32 +01:00
deploy: 8b96ee449a
This commit is contained in:
parent
67c8bf522a
commit
2e222313bb
@ -1,18 +1,36 @@
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14
|
||||
|
||||
LABEL maintainer="Roxedus"
|
||||
|
||||
COPY / /themepark
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
ARG TP_RELEASE
|
||||
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="gilbn"
|
||||
|
||||
RUN \
|
||||
echo " ## Installing packages ## " && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
python3
|
||||
curl && \
|
||||
echo "**** install theme.park ****" && \
|
||||
mkdir -p /app/themepark && \
|
||||
if [ -z ${TP_RELEASE+x} ]; then \
|
||||
TP_RELEASE=$(curl -sX GET "https://api.github.com/repos/gilbn/theme.park/releases/latest" \
|
||||
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/themepark.tar.gz -L \
|
||||
"https://github.com/GilbN/theme.park/archive/refs/tags/${TP_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/themepark.tar.gz -C \
|
||||
/app/themepark/ --strip-components=1 && \
|
||||
cd /app/themepark && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
rm -rf \
|
||||
/root/.cache \
|
||||
/tmp/* \
|
||||
/app/themepark/docker-mods \
|
||||
/app/themepark/resources/organizr
|
||||
|
||||
|
||||
# RUN mkdir -p /usr/share/nginx/html/css/
|
||||
# RUN mkdir -p /usr/share/nginx/html/resources/
|
||||
# RUN cp -R css/ /usr/share/nginx/html/css/
|
||||
# RUN cp -R resources/ /usr/share/nginx/html/resources/
|
||||
# RUN cp index.html /usr/share/nginx/html/index.html
|
||||
#rm -rf /themepark
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
24
docker/root/defaults/default
Normal file
24
docker/root/defaults/default
Normal file
@ -0,0 +1,24 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
server_name _;
|
||||
|
||||
root /app/themepark;
|
||||
index index.html index.htm index.php;
|
||||
|
||||
location / {
|
||||
sub_filter_types *;
|
||||
sub_filter 'https://theme-park.dev' $scheme://TP_DOMAIN;
|
||||
sub_filter 'https://develop.theme-park.dev' $scheme://TP_DOMAIN;
|
||||
sub_filter_once off;
|
||||
try_files $uri $uri/ /index.html /index.php?$args =404;
|
||||
}
|
||||
|
||||
# Don't cache
|
||||
add_header Last-Modified $date_gmt;
|
||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
||||
if_modified_since off;
|
||||
expires -1;
|
||||
etag off;
|
||||
}
|
20
docker/root/etc/cont-init.d/50-config
Normal file
20
docker/root/etc/cont-init.d/50-config
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
echo '------------------'
|
||||
echo '| theme.park |'
|
||||
echo '------------------'
|
||||
|
||||
# Display variables for troubleshooting
|
||||
echo -e "Variables set:\\n\
|
||||
'TP_DOMAIN'=${TP_DOMAIN}\\n"
|
||||
|
||||
if [[ -z ${TP_DOMAIN} ]]; then
|
||||
echo 'No domain set, defaulting to $http_host'
|
||||
TP_DOMAIN='$http_host'
|
||||
fi
|
||||
|
||||
DEFAULT='/config/nginx/site-confs/default'
|
||||
if ! grep -q "sub_filter 'https://theme-park.dev' \$scheme://${TP_DOMAIN};" ${DEFAULT}; then
|
||||
sed -i "s/sub_filter 'https:\/\/theme-park.dev' \$scheme:\/\/TP_DOMAIN;/sub_filter 'https:\/\/theme-park.dev' \$scheme:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
|
||||
sed -i "s/sub_filter 'https:\/\/develop.theme-park.dev' \$scheme:\/\/TP_DOMAIN;/sub_filter 'https:\/\/theme-park.dev' \$scheme:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
|
||||
fi
|
Loading…
Reference in New Issue
Block a user