Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 1.45 KB

README.md

File metadata and controls

79 lines (54 loc) · 1.45 KB

Project build and run

Table of contents

ENV files

Copy .env.example, .env.test.example and .env.test.local.example into files without .example postfix:

cp .env.example .env
cp .env.test.example .env.test
cp .env.local.example .env.local

Run services

  1. To run dev version with --reload option:
docker compose -f docker-compose-dev.yaml up --build

or

docker compose -f docker-compose-dev.yaml build
docker compose -f docker-compose-dev.yaml up
  1. To run project without dev dependencies installed and without --reload option:
docker compose up --build

or

docker compose build
docker compose up

Apply migrations

Usually migration are applied on every start of api service. But you can apply/generate migrations manually:

alembic -n postgresql upgrade head
alembic -n postgresql revision --autogenerate -m "some message"

Run tests

You can run migrations locally in terminal or inside the container.

WARNING

Tests could be run only in dev api-service that was built from Dockerfile.dev because it includes installation of dev project dependencies.

  1. In terminal:
ENVIRONMENT=local pytest tests/
  1. In app container:
docker exec api-service ENVIRONMENT=docker pytest tests/