Changes to add --db-dir option for Postgres.

pull/1321/head
Tariq Islam 2023-04-02 01:41:02 -05:00
rodzic 0ecd53ccb5
commit 04aa66c478
3 zmienionych plików z 11 dodań i 1 usunięć

1
.env
Wyświetl plik

@ -1,6 +1,7 @@
WO_HOST=localhost WO_HOST=localhost
WO_PORT=8000 WO_PORT=8000
WO_MEDIA_DIR=appmedia WO_MEDIA_DIR=appmedia
WO_DB_DIR=dbdata
WO_SSL=NO WO_SSL=NO
WO_SSL_KEY= WO_SSL_KEY=
WO_SSL_CERT= WO_SSL_CERT=

Wyświetl plik

@ -11,7 +11,7 @@ services:
ports: ports:
- "5432" - "5432"
volumes: volumes:
- dbdata:/var/lib/postgresql/data:Z - ${WO_DB_DIR}:/var/lib/postgresql/data:Z
restart: unless-stopped restart: unless-stopped
oom_score_adj: -100 oom_score_adj: -100
webapp: webapp:

Wyświetl plik

@ -33,6 +33,7 @@ source "${__dirname}/.env"
DEFAULT_PORT="$WO_PORT" DEFAULT_PORT="$WO_PORT"
DEFAULT_HOST="$WO_HOST" DEFAULT_HOST="$WO_HOST"
DEFAULT_MEDIA_DIR="$WO_MEDIA_DIR" DEFAULT_MEDIA_DIR="$WO_MEDIA_DIR"
DEFAULT_DB_DIR="$WO_DB_DIR"
DEFAULT_SSL="$WO_SSL" DEFAULT_SSL="$WO_SSL"
DEFAULT_SSL_INSECURE_PORT_REDIRECT="$WO_SSL_INSECURE_PORT_REDIRECT" DEFAULT_SSL_INSECURE_PORT_REDIRECT="$WO_SSL_INSECURE_PORT_REDIRECT"
DEFAULT_BROKER="$WO_BROKER" DEFAULT_BROKER="$WO_BROKER"
@ -60,6 +61,12 @@ case $key in
export WO_MEDIA_DIR export WO_MEDIA_DIR
shift # past argument shift # past argument
shift # past value shift # past value
;;
--db-dir)
WO_DB_DIR=$(realpath "$2")
export WO_DB_DIR
shift # past argument
shift # past value
;; ;;
--ssl) --ssl)
export WO_SSL=YES export WO_SSL=YES
@ -150,6 +157,7 @@ usage(){
echo " --port <port> Set the port that WebODM should bind to (default: $DEFAULT_PORT)" echo " --port <port> Set the port that WebODM should bind to (default: $DEFAULT_PORT)"
echo " --hostname <hostname> Set the hostname that WebODM will be accessible from (default: $DEFAULT_HOST)" echo " --hostname <hostname> Set the hostname that WebODM will be accessible from (default: $DEFAULT_HOST)"
echo " --media-dir <path> Path where processing results will be stored to (default: $DEFAULT_MEDIA_DIR (docker named volume))" echo " --media-dir <path> Path where processing results will be stored to (default: $DEFAULT_MEDIA_DIR (docker named volume))"
echo " --db-dir <path> Path where the Postgres db data will be stored to (default: $DEFAULT_DB_DIR (docker named volume))"
echo " --default-nodes The amount of default NodeODM nodes attached to WebODM on startup (default: $DEFAULT_NODES)" echo " --default-nodes The amount of default NodeODM nodes attached to WebODM on startup (default: $DEFAULT_NODES)"
echo " --with-micmac Create a NodeMICMAC node attached to WebODM on startup. Experimental! (default: disabled)" echo " --with-micmac Create a NodeMICMAC node attached to WebODM on startup. Experimental! (default: disabled)"
echo " --ssl Enable SSL and automatically request and install a certificate from letsencrypt.org. (default: $DEFAULT_SSL)" echo " --ssl Enable SSL and automatically request and install a certificate from letsencrypt.org. (default: $DEFAULT_SSL)"
@ -324,6 +332,7 @@ start(){
echo "Host: $WO_HOST" echo "Host: $WO_HOST"
echo "Port: $WO_PORT" echo "Port: $WO_PORT"
echo "Media directory: $WO_MEDIA_DIR" echo "Media directory: $WO_MEDIA_DIR"
echo "Postgres DB directory: $WO_DB_DIR"
echo "SSL: $WO_SSL" echo "SSL: $WO_SSL"
echo "SSL key: $WO_SSL_KEY" echo "SSL key: $WO_SSL_KEY"
echo "SSL certificate: $WO_SSL_CERT" echo "SSL certificate: $WO_SSL_CERT"