From 3a769ccece9319abac29a002aabed6578b9f4e76 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sun, 15 Feb 2026 14:44:27 -0800 Subject: Add docker-compose.dev.yaml for consistent containerized development environment --- README.md | 21 ++++++++++++--------- docker-compose.dev.yaml | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 docker-compose.dev.yaml diff --git a/README.md b/README.md index ad0744b..1ef1a99 100644 --- a/README.md +++ b/README.md @@ -134,23 +134,26 @@ Utility scripts and test wrappers are located in the `scripts/` directory: ### Development with Containers -If you don't have Go or Node installed locally, or prefer an isolated environment, you can use the provided Dockerfile. Note that the `.devcontainer` VS Code integration has encountered issues with some setups (e.g. Antigravity + Colima), so manual Docker commands are recommended as a fallback. +If you don't have Go or Node installed locally, or prefer an isolated environment, you can use the provided `docker-compose.dev.yaml`. This avoids manual setup and works around some issues with VS Code Dev Containers in certain environments (like Antigravity + Colima). -1. **Build the development image**: +1. **Start the development environment**: ```bash - docker build -t neko-dev -f .devcontainer/Dockerfile . + docker compose -f docker-compose.dev.yaml up -d --build ``` -2. **Run tests**: +2. **Run tests inside the container**: ```bash - # Runs backend tests, installs frontend deps, and runs frontend tests - docker run --rm -v $(pwd):/workspace -w /workspace neko-dev \ - bash -c "go test ./... && cd frontend && npm install && npm test" + docker compose -f docker-compose.dev.yaml exec neko-dev bash -c "go test ./... && cd frontend && npm install && npm test" ``` -3. **Interactive shell**: +3. **Get an interactive shell**: ```bash - docker run -it --rm -v $(pwd):/workspace -w /workspace neko-dev bash + docker compose -f docker-compose.dev.yaml exec neko-dev bash + ``` + +4. **Stop the environment**: + ```bash + docker compose -f docker-compose.dev.yaml down ``` # Configuration diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 0000000..036761d --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,21 @@ +services: + neko-dev: + container_name: neko-dev + build: + context: . + dockerfile: .devcontainer/Dockerfile + volumes: + - .:/workspace + working_dir: /workspace + command: sleep infinity + ports: + # Backend + - "8080:8080" + # Frontend (Vite) + - "5173:5173" + # Optional: Range for dynamic dev tools/debuggers if needed + # (Uncomment if you hit port binding issues with specific tools) + # - "60000-65000:60000-65000" + # Security options to help with permission issues on some setups + security_opt: + - label=disable -- cgit v1.2.3