mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 09:24:52 +03:00
exposed port for django docker container is now configurable
This commit is contained in:
parent
882f505289
commit
933127f097
|
@ -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
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"windows": "n",
|
||||
"use_pycharm": "n",
|
||||
"use_docker": "n",
|
||||
"django_port": "8000",
|
||||
"postgresql_version": [
|
||||
"14",
|
||||
"13",
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -25,7 +25,7 @@ services:
|
|||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "{{ cookiecutter.django_port }}:8000"
|
||||
command: /start
|
||||
|
||||
postgres:
|
||||
|
|
Loading…
Reference in New Issue
Block a user