Create super user inside a Docker container that this used with Compose

Asked

Viewed 282 times

0

I have a Jango project that is running with Docker-Compose, what I need to do and very simple, run python Manage.py createsuperuser, however, even setting the command via dockerfile or in . Compose yml cannot create this super user, someone knows the process that must be done to succeed in what I am trying to do?

  • Maybe this link will help: https://realpython.com/blog/python/django-development-with-docker-compose-and-machine/

  • 1

    managed to solve the problem, simply use: Docker-Compose run --rm api bash -c "python Manage.py createsuperuser" keeping in mind that api and my backend variable in Docker-Compose.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.