Important
The project supports docker compose v2 by default, but if you want to use v1, then you need to add the DOCKER_COMPOSE = docker-compose
line in the Makefile.local
.
- Setup virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
-
Start postgres database
-
Apply migrations:
make migrate
- Fill db with generated data:
make fill-db ratio=100
- Warm up cache:
make warmup-cache
- Run centrifugo server (available on
127.0.0.1:8001
):
make cent
- Run project:
make run
- Open the
127.0.0.1:8000
path in the browser
- Set the
IN_DOCKER
variable inapp/core/local_settings.py
toTrue
IN_DOCKER = True
- Build the container:
make docker-build
- Apply migrations:
make docker-migrate
Important
If you see in the logs that the database does not accept requests, it means that the database container started later than the application container. In this case, you need to run the command again or manually launch the database container first (docker start postgres-service-container
).
- Fill db with generated data:
make docker-fill-db ratio=100
- Run project:
make docker-run
-
Open the
0.0.0.0:8000
path in the browser (centrifugo server available on0.0.0.0:8001
) -
Stop and remove docker containers:
make clear-docker
make migrations
- create migrationsmake migrate
- apply migrationsmake fill-db ratio=<ratio>
- fill database with generated datamake warmup-cache
- warm up the cachemake cent
- start centrifugo servermake run
- start gunicorn servermake superuser
- create superusermake clear-db
- remove data from databasemake clear-db-schema
- remove database schema and data in it
make docker-migrations
- create migrationsmake docker-migrate
- apply migrationsmake docker-fill-db ratio=<ratio>
- fill database with generated datamake docker-run
- start gunicorn servermake docker-superuser
- create superusermake docker-clear-db
- remove data from databasemake docker-clear-db-schema
- remove database schema and data in itmake clear-docker
- stop and remove containers
The results of the service's benchmarks are here.