Template for large application.
Running of this project locally requires the following tools to be present on the host system:
docker
(version 23.05.0+)docker compose
(version 2.21.0+)
To run development environment
-
Go into
docker/development/
folder -
Execute
docker compose up
API description can be accessed on development environment via swagger
on
http://localhost:8000/api/swagger/.
-
Build development environment as described above
-
Execute
docker exec -it large-application-template-backend-development make
CAUTION
: Performance tests are not included
neither in automated tests nor in CI/CD
pipeline.
-
Build development environment as described above
-
Execute
docker exec -it large-application-template-backend-development locust --locustfile "tests/performance/PATH_TO_TESTS_PER_MODULE" --host "http://localhost:8000"
-
Open http://localhost:8089/ in browser
-
[Optional step] Correct provided data
-
Run tests by Locust web interface
To build production docker image :
-
Navigate to the root directory of the project.
-
Execute
docker build -f docker/production/Dockerfile -t large-application-template-backend-production --build-arg {REQUIRED ARGUMENTS} .
The built image can be used as image for:
application
-run-production.sh
as Docker CMD to run applicationworker
-run-worker.sh
asDocker CMD
to run worker
POSTGRES_DB_HOST
- Host of the postgres database
POSTGRES_DB_PORT
- Port of the postgres database
POSTGRES_DB_NAME
- Name of the postgres database
POSTGRES_DB_USER
- User of the postgres database
POSTGRES_DB_PASSWORD
- Password of the postgres database
BROKER_URL
- URL of broker passing messages between application and worker
TZ
- TimeZone identifier (e.g. Europe/Warsaw)
Database migrations are managed by alembic.
-
Go into
migrations/
folder -
Execute
alembic revision --autogenerate -m "<MIGRATION_MESSAGE>"
-
Go into
migrations/
folder -
Execute
alembic upgrade head
backend
folder must be marked asSources Root
inIDE
to make imports work