Komodo, a powerful and versatile platform, offers a streamlined approach to managing and deploying applications. This in-depth guide will walk you through the process of setting up a Komodo cluster using Docker Compose and PostgreSQL as your database backend. We'll cover everything from prerequisites to advanced configuration, ensuring a smooth and efficient deployment.
curl -o komodo/postgres.compose.yaml https://raw.githubusercontent.com/moghtech/komodo/main/compose/postgres.compose.yaml
curl -o komodo/compose.env https://raw.githubusercontent.com/moghtech/komodo/main/compose/compose.env
mkdir -p komodo # Create directory if it doesn't exist
docker compose -p komodo -f komodo/postgres.compose.yaml --env-file komodo/compose.env up -d
docker compose: This invokes the Docker Compose command. -p komodo: This sets the project name to "komodo", ensuring that your deployment is clearly identified within Docker Compose. -f komodo/postgres.compose.yaml: This specifies the Docker Compose configuration file to use. --env-file komodo/compose.env: This instructs Docker Compose to use the compose.env file for environment variables. up -d: This starts the services defined in the configuration file in detached mode (in the background).
###################################
# 🦎 KOMODO COMPOSE - POSTGRES 🦎 #
###################################
# This file defines the services for your Komodo cluster.
services:
postgres: # PostgreSQL database service
image: postgres:17 # Uses the official PostgreSQL 17 image from Docker Hub.
labels:
komodo.skip: # Prevents Komodo from attempting to stop this container.
restart: unless-stopped # Restarts the container unless explicitly stopped.
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local} # Uses the default logging driver.
networks:
- default # Connects the container to the default Docker network.
volumes:
- pg-data:/var/lib/postgresql/data # Persistent storage for PostgreSQL data.
environment:
- POSTGRES_USER=${KOMODO_DB_USERNAME} # PostgreSQL username (from compose.env).
- POSTGRES_PASSWORD=${KOMODO_DB_PASSWORD} # PostgreSQL password (from compose.env).
- POSTGRES_DB=${KOMODO_DATABASE_DB_NAME:-komodo} # PostgreSQL database name (defaults to "komodo").
ferretdb: # FerretDB Mongo adapter service
image: ghcr.io/ferretdb/ferretdb:1 # Uses the FerretDB image.
labels:
komodo.skip: # Prevents Komodo from stopping this container.
restart: unless-stopped # Restarts the container unless explicitly stopped.
depends_on:
- postgres # Ensures PostgreSQL is running before starting FerretDB.
logging:
driver: ${COMPOSE_LOGGING_DRIVER:-local} # Uses the default logging driver.
networks:
- default # Connects to the default Docker network.
environment:
- FERRETDB_POSTGRESQL_URL=postgres://postgres:5432/${KOMODO_DATABASE_DB_NAME:-komodo} # Configures FerretDB to connect to PostgreSQL.
core: # Komodo Core service
# ... (Komodo Core configuration, similar to above) ...
periphery: # Komodo Periphery service
# ... (Komodo Periphery configuration, similar to above) ...
volumes: # Defines named volumes for persistent storage
pg-data: # Volume for PostgreSQL data.
repo-cache: # Volume for Komodo Core's repository cache.
networks: # Defines networks for communication between containers.
default: {} # The default Docker network.
0 comments:
Post a Comment