mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-16 09:54:51 +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
|
windows [n]: n
|
||||||
use_pycharm [n]: y
|
use_pycharm [n]: y
|
||||||
use_docker [n]: n
|
use_docker [n]: n
|
||||||
|
docker_port [8000]: 8000
|
||||||
Select postgresql_version:
|
Select postgresql_version:
|
||||||
1 - 14
|
1 - 14
|
||||||
2 - 13
|
2 - 13
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"windows": "n",
|
"windows": "n",
|
||||||
"use_pycharm": "n",
|
"use_pycharm": "n",
|
||||||
"use_docker": "n",
|
"use_docker": "n",
|
||||||
|
"django_port": "8000",
|
||||||
"postgresql_version": [
|
"postgresql_version": [
|
||||||
"14",
|
"14",
|
||||||
"13",
|
"13",
|
||||||
|
|
|
@ -52,6 +52,9 @@ use_pycharm:
|
||||||
use_docker:
|
use_docker:
|
||||||
Indicates whether the project should be configured to use Docker_ and `Docker Compose`_.
|
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:
|
postgresql_version:
|
||||||
Select a PostgreSQL_ version to use. The choices are:
|
Select a PostgreSQL_ version to use. The choices are:
|
||||||
|
|
||||||
|
|
|
@ -9,5 +9,5 @@ python manage.py migrate
|
||||||
{%- if cookiecutter.use_async == 'y' %}
|
{%- if cookiecutter.use_async == 'y' %}
|
||||||
exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html'
|
exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html'
|
||||||
{%- else %}
|
{%- 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 %}
|
{%- endif %}
|
||||||
|
|
|
@ -25,7 +25,7 @@ services:
|
||||||
- ./.envs/.local/.django
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "{{ cookiecutter.django_port }}:8000"
|
||||||
command: /start
|
command: /start
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user