📌 Description
The repo deploys via railway.json/.railwayignore and documents Postgres via DOCKER_POSTGRES_SETUP.md, but there is no Dockerfile for the Go service and no docker-compose.yml wiring the API, the worker (cmd/worker), Postgres, and NATS together. Local setup and CI/prod parity rely on ad-hoc steps and make dev (air).
💡 Why it matters: A multi-stage Dockerfile and compose file give reproducible local environments and a clear deployable artifact, reducing "works on my machine" issues.
🧩 Requirements and context
- Add a multi-stage
Dockerfile building cmd/api (and a build arg/target for cmd/worker) on the Go 1.24 toolchain, producing a small static image.
- Add
docker-compose.yml with services for api, worker, postgres (with a volume), and nats, wired by env.
- Use
.env.example as the basis for compose env; ensure /ready is used as a healthcheck.
- Document
docker compose up in DEVELOPMENT.md and QUICK_START.md.
- Keep image non-root and minimal.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b devops/dockerfile-and-compose
2. Implement changes
- Write/modify the relevant source:
Dockerfile, docker-compose.yml, .dockerignore
- Write comprehensive tests: a CI job that builds the image and runs
compose up smoke check (optional)
- Add documentation:
DEVELOPMENT.md, QUICK_START.md
- Include comments in the Dockerfile explaining stages
- Validate security assumptions: run as non-root, no secrets baked into the image
3. Test and commit
docker build -t grainlify-api . && docker compose config
- Cover edge cases: worker target builds; healthcheck hits /ready
- Include build output and security notes in the PR description.
Example commit message
devops: add multi-stage Dockerfile and docker-compose
✅ Acceptance criteria
🔒 Security notes
Do not bake secrets or .env into the image; ensure the final stage is non-root and contains no build toolchain.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
The repo deploys via
railway.json/.railwayignoreand documents Postgres viaDOCKER_POSTGRES_SETUP.md, but there is noDockerfilefor the Go service and nodocker-compose.ymlwiring the API, the worker (cmd/worker), Postgres, and NATS together. Local setup and CI/prod parity rely on ad-hoc steps andmake dev(air).🧩 Requirements and context
Dockerfilebuildingcmd/api(and a build arg/target forcmd/worker) on the Go 1.24 toolchain, producing a small static image.docker-compose.ymlwith services for api, worker, postgres (with a volume), and nats, wired by env..env.exampleas the basis for compose env; ensure/readyis used as a healthcheck.docker compose upinDEVELOPMENT.mdandQUICK_START.md.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
Dockerfile,docker-compose.yml,.dockerignorecompose upsmoke check (optional)DEVELOPMENT.md,QUICK_START.md3. Test and commit
Example commit message
✅ Acceptance criteria
🔒 Security notes
Do not bake secrets or
.envinto the image; ensure the final stage is non-root and contains no build toolchain.📋 Guidelines