-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (81 loc) · 2.54 KB
/
Copy pathMakefile
File metadata and controls
97 lines (81 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# RocketTrainer Development Makefile
.PHONY: help setup start stop build test clean logs shell migrate seed
# Default target
help:
@echo "RocketTrainer Development Commands:"
@echo ""
@echo " setup - Initial project setup"
@echo " start - Start development environment"
@echo " stop - Stop all services"
@echo " build - Build all Docker images"
@echo " test - Run all tests"
@echo " clean - Clean up containers and volumes"
@echo " logs - Show logs for all services"
@echo " shell - Open shell in API container"
@echo " migrate - Run database migrations"
@echo " seed - Seed database with initial data"
# Initial setup
setup:
@echo "Setting up RocketTrainer development environment..."
@cp .env.example .env || echo ".env already exists"
@docker-compose build
@docker-compose up -d db redis
@sleep 5
@docker-compose run --rm api alembic upgrade head
@docker-compose run --rm api python scripts/seed_data.py
@echo "Setup complete! Run 'make start' to start the development server."
# Start development environment
start:
@echo "Starting RocketTrainer development environment..."
@docker-compose up -d
@echo "Services started!"
@echo "API: http://localhost:8000"
@echo "Frontend: http://localhost:3000"
@echo "API Docs: http://localhost:8000/docs"
# Stop all services
stop:
@echo "Stopping all services..."
@docker-compose down
# Build all images
build:
@echo "Building Docker images..."
@docker-compose build
# Run tests
test:
@echo "Running backend tests..."
@docker-compose run --rm api pytest
@echo "Running frontend tests..."
@docker-compose run --rm frontend npm test -- --coverage --watchAll=false
# Clean up
clean:
@echo "Cleaning up containers and volumes..."
@docker-compose down -v
@docker system prune -f
# Show logs
logs:
@docker-compose logs -f
# Open shell in API container
shell:
@docker-compose exec api bash
# Run database migrations
migrate:
@echo "Running database migrations..."
@docker-compose run --rm api alembic upgrade head
# Seed database
seed:
@echo "Seeding database with initial data..."
@docker-compose run --rm api python scripts/seed_data.py
# Development helpers
dev-api:
@docker-compose up api db redis
dev-frontend:
@docker-compose up frontend
# Production build
prod-build:
@echo "Building production images..."
@docker-compose -f docker-compose.prod.yml build
# Health check
health:
@echo "Checking service health..."
@curl -f http://localhost:8000/health || echo "API not responding"
@curl -f http://localhost:3000 || echo "Frontend not responding"