hackingtool/docker-compose.yml
Hardik Zinzuvadiya 64b9062c9e Improve Dockerfile, docker-compose, add .dockerignore
Dockerfile:
- Add '# syntax=docker/dockerfile:1' to enable BuildKit features
- Add LABEL metadata (OCI image spec)
- Remove unused apt packages: sudo, python3-venv
- Replace --no-cache-dir with --mount=type=cache for pip (faster rebuilds)
- Add comments explaining each decision

docker-compose.yml:
- Remove deprecated 'version:' field (Compose v2 ignores it, shows warning)
- Add 'image: hackingtool:latest' tag for clarity
- Add 'restart: unless-stopped' for production service
- Add 'hackingtool-dev' profile service with live source volume mount
  so dev workflow (edit without rebuild) is separate from default run
- Clarify volume purpose in comments

.dockerignore (new):
- Exclude .git/, images/, __pycache__/, .github/, *.md, tests/
- Prevents multi-hundred-MB build context; dramatically reduces image size
- Keeps layer cache more stable (README changes no longer bust COPY layer)

README.md / README_template.md:
- Replace single-line Docker snippet with 3-option step-by-step guide:
  Option A: docker run -it --rm (no Compose)
  Option B: docker compose up -d + exec (recommended)
  Option C: docker compose --profile dev (live source mount)
- Add docker compose down / down -v stop instructions
2026-03-15 14:27:36 +05:30

40 lines
1 KiB
YAML

# docker-compose.yml
# Use: docker compose up -d then docker exec -it hackingtool bash
#
# Profiles:
# (default) — runs the built image; code is embedded at build time
# dev — mounts source directory for live editing without rebuilding
# docker compose --profile dev up
services:
hackingtool:
build:
context: .
dockerfile: Dockerfile
image: hackingtool:latest
container_name: hackingtool
stdin_open: true
tty: true
# Persist tools installed at runtime across container restarts
volumes:
- hackingtool_data:/root/.hackingtool
restart: unless-stopped
hackingtool-dev:
build:
context: .
dockerfile: Dockerfile
image: hackingtool:latest
container_name: hackingtool-dev
stdin_open: true
tty: true
profiles:
- dev
volumes:
# Live source mount — code changes are visible without rebuilding
- .:/root/hackingtool
- hackingtool_data:/root/.hackingtool
restart: "no"
volumes:
hackingtool_data: