ERP security module
Docker installed on your machine (Install Docker)
Python virtual env
pyenv virtaulenv 3.12.2 env-name
cd erp-dev-security-1
pyenv activate env-name
pip install -r requirements.txt
pip install --upgrade pip
Replace env-name
with your desired virtual env name.
Add and set .env with vars to use database:
APP_ENVIRONMENT
: development.DB_PORT
: Port of postgresql database (5432).DB_HOST
: Host of database.DB_USER
: User of database.DB_PASSWORD
: Password of database.DB_NAME
: Name of database.POSTGRES_DB="{DB_NAME}"
POSTGRES_USER="{DB_USER}"
POSTGRES_PASSWORD="{DB_PASSWORD}"
DATABASE_URL="postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
AUTH_SECRET_KEY=your-secret-key
AUTH_ALGORITHM=your-algorithm
ACCESS_TOKEN_EXPIRE_MINUTES=token-expiration
IMAGE_NAME=your-img-name
Follow the next steps to build the python and db containers:
Run the following command:
docker compose build --no-cache
docker compose up -d
You can remove flag -d
to show in terminal logs while container is running.
Now you can run the api on your localhost: http://localhost:55
Test