forked from nitrobass24/seedsync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (55 loc) · 1.74 KB
/
Makefile
File metadata and controls
68 lines (55 loc) · 1.74 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
# SeedSync Makefile - Docker Only
# Simplified build system for containerized deployment
.PHONY: all build build-fresh run stop logs clean test test-image size shell help
# Default target
all: build
# Build the Docker image
build:
docker compose -f docker-compose.dev.yml build
# Build without cache
build-fresh:
docker compose -f docker-compose.dev.yml build --no-cache
# Run the container
run:
docker compose -f docker-compose.dev.yml up -d
# Stop the container
stop:
docker compose -f docker-compose.dev.yml down
# View logs
logs:
docker compose -f docker-compose.dev.yml logs -f
# Clean up
clean:
docker compose -f docker-compose.dev.yml down -v --rmi local
rm -rf build/
# Build cached test image (first run only)
test-image:
docker build -t seedsync-test -f src/docker/build/test-image/Dockerfile .
# Run Python tests (in container with runtime dependencies)
test:
$(MAKE) test-image
docker run --rm -v $(PWD)/src/python:/app/python seedsync-test \
pytest tests/unittests -v --tb=short
# Show image size
size:
@docker images seedsync-seedsync --format "Image size: {{.Size}}"
# Shell into running container
shell:
docker exec -it seedsync-dev /bin/bash
# Help
help:
@echo "SeedSync Docker Build System"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " build - Build Docker image"
@echo " build-fresh - Build Docker image without cache"
@echo " run - Start container"
@echo " stop - Stop container"
@echo " logs - View container logs"
@echo " clean - Remove containers and images"
@echo " test - Run Python unit tests"
@echo " test-image - Build cached test image"
@echo " size - Show image size"
@echo " shell - Open shell in running container"