Skip to main content

Getting Up and Running Locally With Docker

Prerequisites

You should have Docker and Docker Compose in your system. Go to the installation instructions to download Docker and the instructions to download Docker Compose.

  1. Run this command in the root directory of the Django project to build the stack:

(You will find "react-frontend" in the docker-compose file. Comment out it if you would like to use React.)

docker-compose -f local.yml build
  1. Run the stack
docker-compose -f local.yml up

and then

docker-compose up
  1. If you would like to execute commands like "migrate", "createsuperuser", you can use this commands
docker-compose -f local.yml run --rm django python manage.py migrate
docker-compose -f local.yml run --rm django python manage.py createsuperuser

Configuration

Environment Variables

You can change the env variables for your needs. You can find them in

.envs
├── .local
│ ├── .django
│ └── .postgres
└── .production
├── .django
└── .postgres

If you would need to merge .envs/.production/* in a single file, you can run the command

python merge_production_dotenvs_in_dotenv.py

For more information using Docker with Hyper Saas, you can visit Django Cookiecutter Docs