Skip to content
Add Service to Dev Compose logo

Add Service to Dev Compose

Add a new microservice to dev-podman-compose.yml with proper configuration, dependencies, and networking.

SKILL.md

Full skill instructions

Add Service to Dev Compose

Add a new microservice to dev-podman-compose.yml following the established patterns.

When to Use

  • Adding a new microservice to local development environment
  • Setting up service dependencies and networking
  • Configuring environment variables
  • Setting up volumes and ports

Instructions

1. Service Template

Add to dev-podman-compose.yml in the services: section:

  # <Service Name> Microservice
  <service-name>-service:
    image: localhost/​frappe-microservices-base:latest
    ports:
      - "<port>:8000"  # Use next available port (8002, 8003, 8004, etc.)
    environment:
      - FRAPPE_SITE=dev.localhost
      - FRAPPE_SITES_PATH=/​app/​sites
      - PYTHONUNBUFFERED=1
      - CENTRAL_SITE_URL=http://dev-frappe-ms-poc-dev-central-site-1:8000
      # Database configuration (central site)
      - DB_HOST=dev-frappe-ms-poc-dev-central-site-1
      - DB_PORT=3306
      - DB_NAME=_9079b9524fe5ca86
      - DB_PASSWORD=687FNguLvKKbFH3T
      - DB_TYPE=mariadb
      # Redis configuration
      - REDIS_HOST=dev-frappe-ms-poc-dev-central-site-1
      - REDIS_PORT=6379
    depends_on:
      dev-central-site:
        condition: service_started
    networks:
      - dev-frappe-network
    volumes:
      - ./<service-name>-service:/​app/​service 
      - ./<service-name>-service/​entrypoint.py:/​app/​entrypoint.py
      - dev_site_data:/​app/​sites:ro  # Optional: if service needs site data
      - ./​frappe-microservice-lib/​frappe_microservice:/​opt/​venv/​lib/​python3.11/​site-packages/​frappe_microservice:ro

2. Port Assignment

Check existing ports and use next available:

  • 8000: Kong Gateway
  • 8080: Central Site
  • 8002: signup-service
  • 8003: orders-service
  • 8004: auth-service
  • 8005: subscription-service
  • 8006: company-service

Next available: 8007, 8008, etc.

3. Service Naming Convention

  • Service name: <service-name>-service (kebab-case)
  • Directory: ./<service-name>-service/ (matches service name)
  • Container name: Auto-generated as dev-frappe-ms-poc-<service-name>-service-1

4. Dependencies

All services depend on dev-central-site:

depends_on:
  dev-central-site:
    condition: service_started

If service depends on another microservice, add it:

depends_on:
  dev-central-site:
    condition: service_started
  orders-service:
    condition: service_started

5. Volumes

Required volumes:

volumes:
  - ./<service-name>-service:/​app/​service 
  - ./<service-name>-service/​entrypoint.py:/​app/​entrypoint.py
  - ./​frappe-microservice-lib/​frappe_microservice:/​opt/​venv/​lib/​python3.11/​site-packages/​frappe_microservice:ro

Optional volumes:

  - dev_site_data:/​app/​sites:ro  # If service needs site data (read-only)

6. Environment Variables

Required:

  • FRAPPE_SITE=dev.localhost
  • FRAPPE_SITES_PATH=/​app/​sites
  • PYTHONUNBUFFERED=1
  • CENTRAL_SITE_URL=http://dev-frappe-ms-poc-dev-central-site-1:8000
  • Database config (DB_HOST, DB_PORT, DB_NAME, DB_PASSWORD, DB_TYPE)
  • Redis config (REDIS_HOST, REDIS_PORT)

Service-specific (add as needed):

- SERVICE_SPECIFIC_VAR=value

7. Add to Kong Gateway

Update kong.yml to add route for new service:

services:
  - name: <service-name>-service
    url: http://<service-name>-service:8000
    routes:
      - name: <service-name>-route
        paths:
          - /<service-name>

Then update dev-podman-compose.yml Kong service dependencies:

  kong:
    depends_on:
      - auth-service
      - signup-service
      - subscription-service
      - company-service
      - orders-service
      - <service-name>-service  # Add here

8. Complete Example

For a new inventory-service on port 8007:

  # Inventory Microservice
  inventory-service:
    image: localhost/​frappe-microservices-base:latest
    ports:
      - "8007:8000"
    environment:
      - FRAPPE_SITE=dev.localhost
      - FRAPPE_SITES_PATH=/​app/​sites
      - PYTHONUNBUFFERED=1
      - CENTRAL_SITE_URL=http://dev-frappe-ms-poc-dev-central-site-1:8000
      - DB_HOST=dev-frappe-ms-poc-dev-central-site-1
      - DB_PORT=3306
      - DB_NAME=_9079b9524fe5ca86
      - DB_PASSWORD=687FNguLvKKbFH3T
      - DB_TYPE=mariadb
      - REDIS_HOST=dev-frappe-ms-poc-dev-central-site-1
      - REDIS_PORT=6379
    depends_on:
      dev-central-site:
        condition: service_started
    networks:
      - dev-frappe-network
    volumes:
      - ./​inventory-service:/​app/​service 
      - ./​inventory-service/​entrypoint.py:/​app/​entrypoint.py
      - ./​frappe-microservice-lib/​frappe_microservice:/​opt/​venv/​lib/​python3.11/​site-packages/​frappe_microservice:ro

9. Verification Steps

After adding service:

  1. Check syntax:

    podman compose -f dev-podman-compose.yml config
    
  2. Start service:

    podman compose -f dev-podman-compose.yml up -d <service-name>-service
    
  3. Check logs:

    podman compose -f dev-podman-compose.yml logs <service-name>-service
    
  4. Test endpoint:

    curl http://localhost:<port>/​health
    

Key Patterns

  1. Consistent Naming: Use kebab-case for service names
  2. Port Management: Track used ports, use next available
  3. Dependencies: Always depend on central-site
  4. Volumes: Mount service code and library
  5. Environment: Use same DB/​Redis config as other services
  6. Networking: Use dev-frappe-network for all services

Common Issues

  • Port conflicts: Check existing ports before assigning
  • Volume paths: Ensure service directory exists
  • Dependencies: Add to Kong depends_on if using gateway
  • Environment vars: Copy from existing service, adjust as needed

More skills from vyogotech

frappe-data-migration-generator logo
vyogotech/frappe-apps-manager

frappe-data-migration-generator

Generate data migration scripts for Frappe. Use when migrating data from legacy systems, transforming data structures, or importing large datasets.

11 0
View
frappe-documentation-generator logo
vyogotech/frappe-apps-manager

frappe-documentation-generator

Generate API documentation, user guides, and technical documentation for Frappe apps. Use when documenting APIs, creating user guides, or generating OpenAPI specs.

11 0
View
frappe-containerfile-generator logo
vyogotech/frappe-apps-manager

frappe-containerfile-generator

Generate Containerfile for Frappe apps using the official frappe/erpnext images with Gunicorn. The recommended pattern copies app source into the bench layout and runs Gunicorn directly.

11 0
View
Generate TDD Tests logo
vyogotech/frappe-apps-manager

Generate TDD Tests

Enforce the Iron Law of TDD for Frappe apps. Red-Green-Refactor cycle for DocTypes and Controllers.

11 0
View
frappe-controller logo
vyogotech/frappe-apps-manager

frappe-controller

Generate Frappe-style DocType controllers with lifecycle methods for microservices.

11 0
View
frappe-app-scaffold logo
vyogotech/frappe-apps-manager

frappe-app-scaffold

Canonical folder structure produced by `bench new-app` for modern Frappe (v14/v15+). Use this as the ground truth for any Frappe app file tree — includes pyproject.toml and module management.

11 0
View
frappe-api-handler logo
vyogotech/frappe-apps-manager

frappe-api-handler

Generate whitelisted API methods and REST endpoints for standard Frappe and microservices.

11 0
View
Validate Microservice Code logo
vyogotech/frappe-apps-manager

Validate Microservice Code

Validate code follows frappe-microservice-lib patterns, security best practices, and framework conventions.

11 0
View
frappe-tenant-query logo
vyogotech/frappe-apps-manager

frappe-tenant-query

Generate tenant-isolated database queries using TenantAwareDB to prevent cross-tenant access.

11 0
View
frappe-secure-endpoint logo
vyogotech/frappe-apps-manager

frappe-secure-endpoint

Generate secure, tenant-aware API endpoints with authentication and tenant isolation.

11 0
View
frappe-web-form-builder logo
vyogotech/frappe-apps-manager

frappe-web-form-builder

Generate Frappe Web Forms for public-facing forms. Use when creating customer portals, registration forms, surveys, or public data collection forms.

11 0
View
frappe-unit-test-generator logo
vyogotech/frappe-apps-manager

frappe-unit-test-generator

Generate comprehensive unit tests for Frappe DocTypes, controllers, and API methods. Use when creating test files, writing test cases, or setting up test infrastructure for Frappe/ERPNext applications.

11 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View