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
- 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
- To run project without dev dependencies installed and without
--reload
option:
docker compose up --build
or
docker compose build
docker compose up
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"
You can run migrations locally in terminal or inside the container.
WARNING
Tests could be run only in dev
api-service
that was built fromDockerfile.dev
because it includes installation of dev project dependencies.
- In terminal:
ENVIRONMENT=local pytest tests/
- In
app
container:
docker exec api-service ENVIRONMENT=docker pytest tests/