Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add container_name for docker commands locally #2545

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Listed in alphabetical order.
Guilherme Guy `@guilherme1guy`_
Hamish Durkin `@durkode`_
Hana Quadara `@hanaquadara`_
Hannah Lazarus `@hanhanhan`_
Harry Moreno `@morenoh149`_ @morenoh149
Harry Percival `@hjwp`_
Hendrik Schneider `@hendrikschneider`_
Expand Down
9 changes: 9 additions & 0 deletions docs/developing-locally-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ django-debug-toolbar
In order for ``django-debug-toolbar`` to work designate your Docker Machine IP with ``INTERNAL_IPS`` in ``local.py``.


docker
""""""

The ``container_name`` from the yml file can be used to check on containers with docker commands, for example: ::

$ docker logs worker
$ docker top worker


Mailhog
~~~~~~~

Expand Down
8 changes: 8 additions & 0 deletions {{cookiecutter.project_slug}}/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
context: .
dockerfile: ./compose/local/django/Dockerfile
image: {{ cookiecutter.project_slug }}_local_django
container_name: django
depends_on:
- postgres
{%- if cookiecutter.use_mailhog == 'y' %}
Expand All @@ -29,6 +30,7 @@ services:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: {{ cookiecutter.project_slug }}_production_postgres
container_name: postgres
volumes:
- local_postgres_data:/var/lib/postgresql/data
- local_postgres_data_backups:/backups
Expand All @@ -38,6 +40,7 @@ services:

mailhog:
image: mailhog/mailhog:v1.0.0
container_name: mailhog
ports:
- "8025:8025"

Expand All @@ -46,10 +49,12 @@ services:

redis:
image: redis:5.0
container_name: redis

celeryworker:
<<: *django
image: {{ cookiecutter.project_slug }}_local_celeryworker
container_name: celeryworker
depends_on:
- redis
- postgres
Expand All @@ -62,6 +67,7 @@ services:
celerybeat:
<<: *django
image: {{ cookiecutter.project_slug }}_local_celerybeat
container_name: celerybeat
depends_on:
- redis
- postgres
Expand All @@ -74,6 +80,7 @@ services:
flower:
<<: *django
image: {{ cookiecutter.project_slug }}_local_flower
container_name: flower
ports:
- "5555:5555"
command: /start-flower
Expand All @@ -86,6 +93,7 @@ services:
context: .
dockerfile: ./compose/local/node/Dockerfile
image: {{ cookiecutter.project_slug }}_local_node
container_name: node
depends_on:
- django
volumes:
Expand Down