- Build images:
make docker-build
- Before running the docker images, you need to create a .env file in the root directory and fill it with your own values:
mv .env.example .env
- Run the docker images:
make docker-up
Now you can access:
- the frontend at http://localhost:your-frontend-port
- the backend at http://localhost:your-backend-port
- the database at http://localhost:your-database-port
To build the docker images, run the following command:
make docker-build
To run the docker images, run the following command:
make docker-up
To go inside a docker image, run the following commands:
make docker-frontend # for the frontend
make docker-backend # for the backend
To stop the docker images, run the following command:
make docker-down
Some useful commands.
Go inside the backend docker image and set up a virtual environment:
make docker-backend # go inside the backend docker image
python3 -m venv venv
source venv/bin/activate
Install a dependency:
pip install --upgrade pip
pip install your-dependency
Generate requirements.txt:
pip freeze > src/requirements.txt
Create new app:
cd src
python manage.py startapp your-app-name
Create migrations:
python manage.py makemigrations
Apply migrations:
python manage.py migrate
Create fixtures from api:
python manage.py dumpdata api > data.json
Load fixtures:
python manage.py loaddata data.json