exposed port for django docker container is now configurable

This commit is contained in:
Henry Jobst 2022-12-20 12:44:22 +01:00
parent 882f505289
commit 933127f097
5 changed files with 7 additions and 2 deletions

View File

@ -120,6 +120,7 @@ Answer the prompts with your own desired [options](http://cookiecutter-django.re
windows [n]: n
use_pycharm [n]: y
use_docker [n]: n
docker_port [8000]: 8000
Select postgresql_version:
1 - 14
2 - 13

View File

@ -17,6 +17,7 @@
"windows": "n",
"use_pycharm": "n",
"use_docker": "n",
"django_port": "8000",
"postgresql_version": [
"14",
"13",

View File

@ -52,6 +52,9 @@ use_pycharm:
use_docker:
Indicates whether the project should be configured to use Docker_ and `Docker Compose`_.
docker_port:
External port for the django app when run as docker container
postgresql_version:
Select a PostgreSQL_ version to use. The choices are:

View File

@ -9,5 +9,5 @@ python manage.py migrate
{%- if cookiecutter.use_async == 'y' %}
exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html'
{%- else %}
exec python manage.py runserver_plus 0.0.0.0:8000
exec python manage.py runserver_plus 0.0.0.0:{{ cookiecutter.django_port }}
{%- endif %}

View File

@ -25,7 +25,7 @@ services:
- ./.envs/.local/.django
- ./.envs/.local/.postgres
ports:
- "8000:8000"
- "{{ cookiecutter.django_port }}:8000"
command: /start
postgres: