Skip to content

Add Docker and docker-compose configuration for local development and deployment #162

Description

@Josie123-Dev

What

Create a Dockerfile for the backend, a Dockerfile for the frontend, and a docker-compose.yml at the project root that orchestrates all services (backend, frontend, PostgreSQL, Redis) for local development.

Why

DEPLOYMENT.md and README.md both reference Docker, but no Dockerfile or docker-compose configuration exists. New contributors currently need to manually install PostgreSQL, Redis, Node.js, Rust, and Circom just to run the backend locally. A docker-compose setup reduces onboarding from hours to minutes and ensures consistent environments across contributors.

Scope

In scope:

  • backend/Dockerfile — multi-stage build (build + production)
  • frontend/Dockerfile — multi-stage build (build + production)
  • docker-compose.yml at root — backend, frontend, postgres, redis services
  • .dockerignore files for backend and frontend
  • Environment variable configuration via .env file (reference .env.example)
  • Health checks for all services in docker-compose

Out of scope:

  • Kubernetes manifests
  • CI/CD Docker image publishing
  • Smart contract compilation in Docker (Rust/WASM toolchain is heavy; keep as local install)
  • ZK circuit compilation in Docker

Acceptance Criteria

  • docker-compose up starts all 4 services (backend, frontend, postgres, redis)
  • Backend is accessible at http://localhost:3001/api/v1
  • Frontend is accessible at http://localhost:3000
  • PostgreSQL and Redis are accessible from the backend container
  • docker-compose down -v cleanly tears down all services and volumes
  • Dockerfiles use multi-stage builds for minimal production images
  • .dockerignore excludes node_modules, .git, dist, target

Technical Context

  • Backend: NestJS on port 3001 (see backend/src/main.ts)
  • Frontend: Next.js on port 3000 (default)
  • PostgreSQL: default port 5432, database name from .env.example
  • Redis: default port 6379
  • Backend .env.example has 71 lines of env vars — use these as the template
  • Backend uses TypeORM with synchronize: true in dev — migrations not required for local dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaigndevopsDevOps and deploymentdifficulty:hardHard difficulty issuesinfrastructureInfrastructure and DevOpspriority:highHigh priority issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions