kopia lustrzana https://github.com/OpenDroneMap/WebODM
Environmental variables, nginx templates
rodzic
68fd2da296
commit
a2b8267cd5
|
@ -0,0 +1,3 @@
|
|||
HOST=webodm.localhost
|
||||
PORT=8000
|
||||
APP_MEDIA_DIR=appmedia
|
|
@ -93,3 +93,4 @@ node_modules/
|
|||
webpack-stats.json
|
||||
pip-selfcheck.json
|
||||
.idea/
|
||||
package-lock.json
|
||||
|
|
|
@ -27,7 +27,7 @@ RUN printf "deb http://mirror.steadfast.net/debian/ stable main contrib n
|
|||
RUN printf "deb http://mirror.steadfast.net/debian/ testing main contrib non-free\ndeb-src http://mirror.steadfast.net/debian/ testing main contrib non-free" > /etc/apt/sources.list.d/testing.list
|
||||
|
||||
# Install GDAL, nginx
|
||||
RUN apt-get update && apt-get install -t testing -y binutils libproj-dev gdal-bin nginx
|
||||
RUN apt-get update && apt-get install -t testing -y binutils libproj-dev gdal-bin nginx gettext-base
|
||||
|
||||
WORKDIR /webodm/nodeodm/external/node-OpenDroneMap
|
||||
RUN npm install
|
||||
|
|
|
@ -19,9 +19,12 @@ services:
|
|||
container_name: webapp
|
||||
entrypoint: /bin/bash -c "chmod +x /webodm/*.sh && /bin/bash -c \"/webodm/wait-for-it.sh db:5432 -- /webodm/start.sh\""
|
||||
volumes:
|
||||
- appmedia:/webodm/app/media
|
||||
- ${MEDIA_DIR}:/webodm/app/media
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "${PORT}:8000"
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
- PORT
|
||||
- HOST
|
||||
restart: on-failure:10
|
|
@ -0,0 +1,2 @@
|
|||
ssl/
|
||||
*.conf
|
|
@ -31,8 +31,7 @@ http {
|
|||
listen 8000 deferred;
|
||||
client_max_body_size 0;
|
||||
|
||||
# set the correct host(s) for your site
|
||||
server_name webodm.localhost;
|
||||
server_name $HOST;
|
||||
|
||||
keepalive_timeout 5;
|
||||
|
14
start.sh
14
start.sh
|
@ -74,7 +74,19 @@ if [ "$1" = "--setup-devenv" ] || [ "$2" = "--setup-devenv" ] || [ "$1" = "--no-
|
|||
else
|
||||
if [ -e /webodm ] && [ ! -e /webodm/build/static ]; then
|
||||
echo -e "\033[91mWARN:\033[39m /webodm/build/static does not exist, CSS, JS and other files might not be available."
|
||||
fi
|
||||
fi
|
||||
|
||||
# If this is invoked outside docker, we need to make sure
|
||||
# envsubst returns a valid config file...
|
||||
export HOST="${HOST:=webodm.localhost}"
|
||||
|
||||
echo "Generating nginx configurations from templates..."
|
||||
for templ in nginx/*.template
|
||||
do
|
||||
echo "- $templ"
|
||||
envsubst '\$HOST \$OTHER_VAR' < $templ > ${templ%.*}
|
||||
done
|
||||
|
||||
nginx -c $(pwd)/nginx/nginx.conf
|
||||
gunicorn webodm.wsgi --bind unix:/tmp/gunicorn.sock --timeout 360 --preload
|
||||
fi
|
||||
|
|
11
webodm.sh
11
webodm.sh
|
@ -16,6 +16,11 @@ if [[ $platform = "Windows" ]]; then
|
|||
export COMPOSE_CONVERT_WINDOWS_PATHS=1
|
||||
fi
|
||||
|
||||
# Set default ENV variables
|
||||
export PORT="${WEBODM_PORT:=8000}"
|
||||
export HOST="${WEBODM_HOST:=webodm.localhost}"
|
||||
export MEDIA_DIR="${WEBODM_MEDIA_DIR:=appmedia}"
|
||||
|
||||
usage(){
|
||||
echo "Usage: $0 <command> [options]"
|
||||
echo
|
||||
|
@ -121,6 +126,12 @@ resetpassword(){
|
|||
if [[ $1 = "start" ]]; then
|
||||
environment_check
|
||||
echo "Starting WebODM..."
|
||||
|
||||
|
||||
echo -e "Host: \033[92m\033[1m$PORT\033[0m\033[39m"
|
||||
echo -e "Port: \033[92m\033[1m$HOST\033[0m\033[39m"
|
||||
echo -e "Media dir: \033[92m\033[1m$HOST\033[0m\033[39m"
|
||||
|
||||
start
|
||||
elif [[ $1 = "stop" ]]; then
|
||||
environment_check
|
||||
|
|
Ładowanie…
Reference in New Issue