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

Why is a separate Dockerfile necessary for Traefik #2822

Closed
arnav13081994 opened this issue Sep 13, 2020 · 6 comments
Closed

Why is a separate Dockerfile necessary for Traefik #2822

arnav13081994 opened this issue Sep 13, 2020 · 6 comments
Labels

Comments

@arnav13081994
Copy link
Contributor

arnav13081994 commented Sep 13, 2020

I am not able to understand the reason why a custom traefik Docerfile is being used.

The static and dynamic config files can be mounted as ro Read-Only in the container and acme.json file is something that traefik creates on its own, so creating and setting 0600 permissions also seem unnecessary.

The whole file seems unnecessary to me. Am I missing something?

@demestav
Copy link
Contributor

What alternative do you suggest?

@arnav13081994
Copy link
Contributor Author

arnav13081994 commented Sep 13, 2020

@demestav

Docker-compose can just have this for traefik service:

  traefik:
    image: traefik:v2.2.11
    depends_on:
      - django
    volumes:
      - ./docker/traefik/production/traefik.yml:/etc/traefik/traefik.yml:ro
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"
      {%- if cookiecutter.use_celery == 'y' %}
      - "0.0.0.0:5555:5555"
      {%- endif %}

And Dockerfile can be removed for Traefik.

@demestav
Copy link
Contributor

Thank you. Regarding the acme.json file, I can't recall exactly why, but there an error was popping up if it wasn't created like that. But that was over 2 years ago (?). So it might not be relevant now. Regarding the Dockerfile, the docker image will still be created, so essentially what you propose will reduce the cookiecutter's files by 1. Yes, why not. Let's wait and see what the maintainers have to say.

Note that you are missing the acme volume in your definition above. If you don't include it, then in the event that you recreate the container, a new certificate will be issued which is not desirable.

@arnav13081994
Copy link
Contributor Author

@demestav Good catch.

@browniebroke
Copy link
Member

I think we would need a separate Dockerfile to fix #1992 as we can see in #2217.

@arnav13081994
Copy link
Contributor Author

@browniebroke Ok makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants