Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.57 KB

readme.md

File metadata and controls

32 lines (23 loc) · 1.57 KB

Inventory Management System

Quick Start

  1. Install poetry and project requirements with poetry install. It will automatically create python virtualenv and manage python requirements for you.

  2. Create .env file with following variables:

COMPOSE_PROJECT_NAME="inventory"
POSTGRES_DSN="postgresql://postgres:postgres@localhost:5432/main"
TELEGRAM_TOKEN="<your telegram bot token>"
  1. Run docker compose (postgres only): docker compose --env-file .env up postgres --build -d. Now you have a postgres instance running on localhost:5432. If the port is busy, try another - replace it both in docker-compose.yml and .env.

  2. Run migrations for postgres: poetry run pem migrate.

  3. Run python application locally (without docker): poetry run python main.py. It's recommended to always use poetry run instead of poetry shell because it ensures that environment variables from .env are always reloaded.

  4. To deploy entire stack (postgresql + python app) on a remote server, configure docker context and deploy as usual: docker --context <your server> compose --env-file .env up --build -d.

Technologies Used