Skip to content

Latest commit

 

History

History
147 lines (105 loc) · 2.78 KB

useful_commands.md

File metadata and controls

147 lines (105 loc) · 2.78 KB

Useful Commands

Poetry

Export python dependencies from poetry to requirements.txt

poetry export --without-hashes --format=requirements.txt > requirements.txt

Show outdated packages

poetry show --outdated

Run tests using pytest

 # pytest -rpP
 poetry poe tests

Git hooks

Install git hooks

# pre-commit install --hook-type commit-msg --hook-type pre-push --hook-type pre-commit
poetry poe git-hooks-setup

Updating hooks automatically

# pre-commit autoupdate
poetry poe git-hooks-update

Docker

Dockerfile

List all docker processes

docker ps

Build the images

docker build --file Dockerfile.dev --tag rearwing-dev .
docker build --file Dockerfile.prod --tag rearwing-prod .

Start the containers

docker run --detach --name rearwing-dev --publish 8081:8081 rearwing-dev
docker run --detach --name rearwing-prod --publish 80:80 rearwing-prod

Stop the containers

docker stop rearwing-dev
docker stop rearwing-prod

Restart the containers

docker restart rearwing-dev
docker restart rearwing-prod

Compose

List all docker processes

docker compose --file compose.dev.yaml ps

Build the services

docker compose --file compose.dev.yaml build

Bring up the services

docker compose --file compose.dev.yaml up --detach

Build and bring up the services

docker compose --file compose.dev.yaml up --build --detach

PM2

Start process

pm2 start process.config.js

Stop process

pm2 stop process.config.js

Check process status

pm2 status