diff --git a/.gitignore b/.gitignore index 7b6caf3..bfff5f4 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,6 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ + +postgres_data/ +.prod.env \ No newline at end of file diff --git a/README.md b/README.md index a02223e..22814be 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ To create the first user, open the container's console using Unraid's UI, by cli | variable | type | default | explanation | |-------------------------------|-------------|-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| INTERNAL_PORT | int | 8000 | The port on which the app listens on. Defaults to 8000 if not set. | | DJANGO_ALLOWED_HOSTS | string | localhost 127.0.0.1 | A list of space separated domains and IPs representing the host/domain names that WYGIWYH site can serve. [Click here](https://docs.djangoproject.com/en/5.1/ref/settings/#allowed-hosts) for more details | | HTTPS_ENABLED | true\|false | false | Whether to use secure cookies. If this is set to true, the cookie will be marked as “secure”, which means browsers may ensure that the cookie is only sent under an HTTPS connection | | URL | string | http://localhost http://127.0.0.1 | A list of space separated domains and IPs (with the protocol) representing the trusted origins for unsafe requests (e.g. POST). [Click here](https://docs.djangoproject.com/en/5.1/ref/settings/#csrf-trusted-origins ) for more details | diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d632e4f..7a261e1 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -15,7 +15,7 @@ services: - ./frontend/:/usr/src/frontend:z - wygiwyh_temp:/usr/src/app/temp/ ports: - - "${OUTBOUND_PORT}:8000" + - "${OUTBOUND_PORT:-8000}:${INTERNAL_PORT:-8000}" env_file: - .env depends_on: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index c0c10a0..56b2587 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -4,7 +4,7 @@ services: container_name: ${SERVER_NAME} command: /start-single ports: - - "${OUTBOUND_PORT}:8000" + - "${OUTBOUND_PORT:-8000}:${INTERNAL_PORT:-8000}" env_file: - .env depends_on: diff --git a/docker/dev/django/start b/docker/dev/django/start index 8fe851c..80d4bc3 100644 --- a/docker/dev/django/start +++ b/docker/dev/django/start @@ -4,6 +4,9 @@ set -o errexit set -o pipefail set -o nounset +# Set INTERNAL_PORT with default value of 8000 +INTERNAL_PORT=${INTERNAL_PORT:-8000} + rm -f /tmp/migrations_complete python manage.py migrate @@ -13,4 +16,4 @@ touch /tmp/migrations_complete python manage.py setup_users -exec python manage.py runserver 0.0.0.0:8000 +exec python manage.py runserver 0.0.0.0:$INTERNAL_PORT diff --git a/docker/prod/django/start b/docker/prod/django/start index ffb47a8..fe02e50 100644 --- a/docker/prod/django/start +++ b/docker/prod/django/start @@ -4,6 +4,9 @@ set -o errexit set -o pipefail set -o nounset +# Set INTERNAL_PORT with default value of 8000 +INTERNAL_PORT=${INTERNAL_PORT:-8000} + # Remove flag file if it exists from previous run rm -f /tmp/migrations_complete @@ -15,4 +18,4 @@ touch /tmp/migrations_complete python manage.py setup_users -exec gunicorn WYGIWYH.wsgi:application --bind 0.0.0.0:8000 --timeout 600 +exec gunicorn WYGIWYH.wsgi:application --bind 0.0.0.0:$INTERNAL_PORT --timeout 600