Skip to main content
Docker Compose provides a simple way to run the entire QeetMart platform locally for development and testing. The configuration orchestrates all microservices, databases, and supporting infrastructure.

Prerequisites

Before deploying with Docker Compose, ensure you have:
  • Docker Engine 24.0 or later
  • Docker Compose V2
  • At least 4GB of available RAM
  • Ports 4000-4001, 8080, 8082-8083 available

Quick start

1

Clone the repository

git clone https://github.com/qeetgroup/qeetmart.git
cd qeetmart
2

Start all services

docker compose -f docker-compose.dev.yml up -d
This command starts:
  • API Gateway (port 4000)
  • Auth Service (port 4001)
  • User Service (port 8082)
  • Product Service (port 8083)
  • Inventory Service (port 8080)
  • PostgreSQL databases for each service
  • Redis for inventory caching
3

Verify services are running

docker compose -f docker-compose.dev.yml ps
All services should show status as running.
4

Test the API

curl http://localhost:4000/health

Service architecture

The Docker Compose configuration includes the following services:

API Gateway

The main entry point for all client requests, running on port 4000.
gateway:
  build:
    context: .
    dockerfile: micros/api-gateway/Dockerfile
  environment:
    PORT: "4000"
    HOST: "0.0.0.0"
    TRUST_PROXY: "true"
    CORS_ORIGINS: "http://localhost:3000,http://localhost:5173"
    AUTH_SERVICE_URL: "http://auth-service:4001"
    USER_SERVICE_URL: "http://user-service:8082"
    PRODUCT_SERVICE_URL: "http://product-service:8083"
    INVENTORY_SERVICE_URL: "http://inventory-service:8080"
  ports:
    - "4000:4000"

Auth Service

Handles authentication and JWT token generation, backed by PostgreSQL.
auth-service:
  build:
    context: micros/auth-service
    dockerfile: Dockerfile
  environment:
    SERVER_PORT: "4001"
    DB_HOST: auth-db
    DB_NAME: auth_db
    DB_USERNAME: postgres
    DB_PASSWORD: postgres
    JWT_SECRET: CHANGE_ME_TO_A_32_BYTE_MINIMUM_SECRET_123456
  depends_on:
    auth-db:
      condition: service_healthy

Inventory Service

Go-based service for inventory management with PostgreSQL and Redis.
inventory-service:
  build:
    context: micros/inventory-service
    dockerfile: Dockerfile
  environment:
    PORT: "8080"
    GIN_MODE: "release"
    DATABASE_URL: "postgres://postgres:postgres@inventory-db:5432/inventory?sslmode=disable"
    REDIS_ADDR: "inventory-redis:6379"
    RESERVATION_TTL: "10m"
    EXPIRATION_POLL_INTERVAL: "30s"
  depends_on:
    inventory-db:
      condition: service_healthy
    inventory-redis:
      condition: service_healthy

Configuration

Environment variables

The development configuration uses default values suitable for local development. For production use, you should override these values.
The default JWT secret CHANGE_ME_TO_A_32_BYTE_MINIMUM_SECRET_123456 is insecure. Always use a cryptographically random secret in production.

Database health checks

All PostgreSQL databases include health checks to ensure services start in the correct order:
auth-db:
  image: postgres:16-alpine
  healthcheck:
    test: ["CMD-SHELL", "pg_isready -U postgres -d auth_db"]
    interval: 5s
    timeout: 5s
    retries: 20

Data persistence

Database data is persisted using Docker volumes:
volumes:
  auth_db_data:
  user_db_data:
  product_db_data:
  inventory_db_data:
To reset all data, remove the volumes:
docker compose -f docker-compose.dev.yml down -v

Managing services

docker compose -f docker-compose.dev.yml up -d

Service endpoints

Once running, services are available at:
ServiceURLDescription
API Gatewayhttp://localhost:4000Main entry point
Auth Servicehttp://localhost:4001Authentication
User Servicehttp://localhost:8082User management
Product Servicehttp://localhost:8083Product catalog
Inventory Servicehttp://localhost:8080Inventory tracking

Troubleshooting

Port conflicts

If ports are already in use, modify the port mappings in docker-compose.dev.yml:
ports:
  - "4001:4000"  # Map to different host port

Service won’t start

Check the service logs:
docker compose -f docker-compose.dev.yml logs service-name

Database connection issues

Ensure the database health checks are passing:
docker compose -f docker-compose.dev.yml ps
Look for healthy status on database services.

Reset everything

To completely reset the environment:
docker compose -f docker-compose.dev.yml down -v
docker compose -f docker-compose.dev.yml up -d --build
This deployment configuration is optimized for development. For production deployments, use Kubernetes or Helm charts with proper secrets management and resource limits.

Build docs developers (and LLMs) love