use local sources when building Docker image, add LOCAL_PHP and LOCAL_PHP_REMOTE to settings.json and fix pip bug related to removed working directory
This commit is contained in:
parent
8e3dbf1c70
commit
71cf3cf5c1
@ -1,5 +1,6 @@
|
|||||||
FROM nginx:1.20.1-alpine
|
FROM nginx:1.20.1-alpine
|
||||||
|
|
||||||
|
COPY . /tmp/bunkerized-nginx-docker
|
||||||
COPY helpers/install.sh /tmp/install.sh
|
COPY helpers/install.sh /tmp/install.sh
|
||||||
RUN apk --no-cache add bash && \
|
RUN apk --no-cache add bash && \
|
||||||
chmod +x /tmp/install.sh && \
|
chmod +x /tmp/install.sh && \
|
||||||
|
|||||||
@ -297,6 +297,7 @@ if [ "$OS" = "" ] ; then
|
|||||||
echo "[!] Unsupported Operating System"
|
echo "[!] Unsupported Operating System"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
old_dir="${PWD}"
|
||||||
|
|
||||||
# Create /tmp/bunkerized-nginx
|
# Create /tmp/bunkerized-nginx
|
||||||
echo "[*] Prepare /tmp/bunkerized-nginx"
|
echo "[*] Prepare /tmp/bunkerized-nginx"
|
||||||
@ -307,8 +308,9 @@ do_and_check_cmd mkdir /tmp/bunkerized-nginx
|
|||||||
|
|
||||||
# Create /opt/bunkerized-nginx
|
# Create /opt/bunkerized-nginx
|
||||||
echo "[*] Prepare /opt/bunkerized-nginx"
|
echo "[*] Prepare /opt/bunkerized-nginx"
|
||||||
if [ -e "/opt/bunkerized-nginx" ] ; then
|
if [ -d "/opt/bunkerized-nginx" ] ; then
|
||||||
do_and_check_cmd rm -rf /opt/bunkerized-nginx
|
echo "[!] Looks like bunkerized-nginx is already installed"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
do_and_check_cmd mkdir -p /opt/bunkerized-nginx/deps
|
do_and_check_cmd mkdir -p /opt/bunkerized-nginx/deps
|
||||||
|
|
||||||
@ -587,6 +589,7 @@ do_and_check_cmd chmod 744 /usr/lib/nginx/modules/*
|
|||||||
if [ "$OS" = "alpine" ] ; then
|
if [ "$OS" = "alpine" ] ; then
|
||||||
apk del build > /dev/null 2>&1
|
apk del build > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
cd "$old_dir"
|
||||||
cleanup
|
cleanup
|
||||||
echo "[*] Dependencies for bunkerized-nginx successfully installed !"
|
echo "[*] Dependencies for bunkerized-nginx successfully installed !"
|
||||||
|
|
||||||
@ -614,11 +617,16 @@ elif [ "$OS" = "alpine" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Clone the repo
|
# Clone the repo
|
||||||
echo "[*] Clone bunkerity/bunkerized-nginx"
|
if [ "$OS" != "alpine" ] ; then
|
||||||
#CHANGE_DIR="/tmp" do_and_check_cmd git_secure_clone https://github.com/bunkerity/bunkerized-nginx.git 09a2a4f9e531b93684b0916a5146091a818501d3
|
echo "[*] Clone bunkerity/bunkerized-nginx"
|
||||||
# TODO : do a secure clone
|
#CHANGE_DIR="/tmp" do_and_check_cmd git_secure_clone https://github.com/bunkerity/bunkerized-nginx.git 09a2a4f9e531b93684b0916a5146091a818501d3
|
||||||
CHANGE_DIR="/tmp" do_and_check_cmd git clone https://github.com/bunkerity/bunkerized-nginx.git
|
# TODO : do a secure clone
|
||||||
CHANGE_DIR="/tmp/bunkerized-nginx" do_and_check_cmd git checkout dev
|
CHANGE_DIR="/tmp" do_and_check_cmd git clone https://github.com/bunkerity/bunkerized-nginx.git
|
||||||
|
CHANGE_DIR="/tmp/bunkerized-nginx" do_and_check_cmd git checkout dev
|
||||||
|
# Docker build case : simply rename the sources
|
||||||
|
else
|
||||||
|
do_and_check_cmd mv /tmp/bunkerized-nginx-docker /tmp/bunkerized-nginx
|
||||||
|
fi
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
echo "[*] Install python dependencies"
|
echo "[*] Install python dependencies"
|
||||||
@ -840,6 +848,6 @@ echo "[*] Download geoip DB"
|
|||||||
do_and_check_cmd /opt/bunkerized-nginx/scripts/geoip.sh
|
do_and_check_cmd /opt/bunkerized-nginx/scripts/geoip.sh
|
||||||
|
|
||||||
# We're done
|
# We're done
|
||||||
echo "[*] Remove temp files"
|
cd "$old_dir"
|
||||||
do_and_check_cmd rm -rf /tmp/bunkerized-nginx
|
cleanup
|
||||||
echo "[*] bunkerized-nginx successfully installed !"
|
echo "[*] bunkerized-nginx successfully installed !"
|
||||||
|
|||||||
@ -1008,6 +1008,24 @@
|
|||||||
"label": "Remote php path",
|
"label": "Remote php path",
|
||||||
"regex": "^/([A-Za-z0-9\\-]/?)*$",
|
"regex": "^/([A-Za-z0-9\\-]/?)*$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "multisite",
|
||||||
|
"default": "",
|
||||||
|
"env": "LOCAL_PHP",
|
||||||
|
"id": "local-php",
|
||||||
|
"label": "local php",
|
||||||
|
"regex": "^([a-zA-Z\\-0-9\\_\\./])*$",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "multisite",
|
||||||
|
"default": "/app",
|
||||||
|
"env": "LOCAL_PHP_PATH",
|
||||||
|
"id": "local-php-path",
|
||||||
|
"label": "Local php path",
|
||||||
|
"regex": "^/([A-Za-z0-9\\-]/?)*$",
|
||||||
|
"type": "text"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user