fix(docker): setting nginx run ports

This commit is contained in:
kolaente 2021-10-04 20:43:43 +02:00
parent a843cddbc9
commit 78ec87360e
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

6
run.sh
View file

@ -5,15 +5,15 @@
VIKUNJA_API_URL="${VIKUNJA_API_URL:-"/api/v1"}" VIKUNJA_API_URL="${VIKUNJA_API_URL:-"/api/v1"}"
VIKUNJA_HTTP_PORT="${VIKUNJA_HTTP_PORT:-80}" VIKUNJA_HTTP_PORT="${VIKUNJA_HTTP_PORT:-80}"
VIKUNJA_HTTPS_PORT="${VIKUNJA_HTTP_PORT:-443}" VIKUNJA_HTTPS_PORT="${VIKUNJA_HTTPS_PORT:-443}"
# Escape the variable to prevent sed from complaining # Escape the variable to prevent sed from complaining
VIKUNJA_API_URL=$(echo $VIKUNJA_API_URL |sed 's/\//\\\//g') VIKUNJA_API_URL=$(echo $VIKUNJA_API_URL |sed 's/\//\\\//g')
sed -i "s/http\:\/\/localhost\:3456\/api\/v1/$VIKUNJA_API_URL/g" /usr/share/nginx/html/index.html sed -i "s/http\:\/\/localhost\:3456\/api\/v1/$VIKUNJA_API_URL/g" /usr/share/nginx/html/index.html
sed -i "s/listen 80/listen $VIKUNJA_HTTP_PORT/g" nginx.conf sed -i "s/listen 80/listen $VIKUNJA_HTTP_PORT/g" /etc/nginx/nginx.conf
sed -i "s/listen 443/listen $VIKUNJA_HTTPS_PORT/g" nginx.conf sed -i "s/listen 443/listen $VIKUNJA_HTTPS_PORT/g" /etc/nginx/nginx.conf
# Set the uid and gid of the nginx run user # Set the uid and gid of the nginx run user
usermod --non-unique --uid ${PUID} nginx usermod --non-unique --uid ${PUID} nginx