You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.8 KiB
82 lines
1.8 KiB
.PHONY: help build up down restart logs shell test clean install db-migrate |
|
|
|
# Default target |
|
help: |
|
@echo "Available commands:" |
|
@echo " make install - Install Python dependencies" |
|
@echo " make build - Build Docker image" |
|
@echo " make up - Start Docker containers" |
|
@echo " make down - Stop Docker containers" |
|
@echo " make restart - Restart Docker containers" |
|
@echo " make logs - Show Docker logs" |
|
@echo " make shell - Open shell in container" |
|
@echo " make test - Run tests" |
|
@echo " make clean - Clean up containers and volumes" |
|
@echo " make db-migrate - Create database tables" |
|
|
|
# Install dependencies |
|
install: |
|
@echo "Installing dependencies..." |
|
pip3 install -r requirements.txt |
|
|
|
# Build Docker image |
|
build: |
|
@echo "Building Docker image..." |
|
docker-compose build |
|
|
|
# Start containers |
|
up: |
|
@echo "Starting containers..." |
|
docker-compose up -d |
|
@echo "✅ Application started at http://localhost:8000" |
|
@echo "📚 API Documentation: http://localhost:8000/api/v1/docs" |
|
|
|
# Stop containers |
|
down: |
|
@echo "Stopping containers..." |
|
docker-compose down |
|
|
|
# Restart containers |
|
restart: down up |
|
|
|
# Show logs |
|
logs: |
|
docker-compose logs -f app |
|
|
|
# Open shell in container |
|
shell: |
|
docker-compose exec app bash |
|
|
|
# Run tests |
|
test: |
|
@echo "Running tests..." |
|
python3 -m pytest tests/ -v |
|
|
|
# Clean up |
|
clean: |
|
@echo "Cleaning up..." |
|
docker-compose down -v |
|
rm -rf data/*.db |
|
rm -rf uploads/* |
|
|
|
# Create database tables |
|
db-migrate: |
|
@echo "Creating database tables..." |
|
python3 -c "from apiApp.database import Base, engine; Base.metadata.create_all(bind=engine); print('✅ Database tables created')" |
|
|
|
# Development run |
|
dev: |
|
@echo "Starting development server..." |
|
python3 run.py |
|
|
|
# Format code |
|
format: |
|
@echo "Formatting code..." |
|
black apiApp/ |
|
isort apiApp/ |
|
|
|
# Lint code |
|
lint: |
|
@echo "Linting code..." |
|
flake8 apiApp/ |
|
mypy apiApp/
|
|
|