81 lines
2.7 KiB
YAML
81 lines
2.7 KiB
YAML
# Use external network from infrastructure
|
|
networks:
|
|
mapleopentech-dev:
|
|
external: true
|
|
|
|
services:
|
|
app:
|
|
container_name: maplepress-backend-dev
|
|
stdin_open: true
|
|
build:
|
|
context: .
|
|
dockerfile: ./dev.Dockerfile
|
|
ports:
|
|
- "${SERVER_PORT:-8000}:${SERVER_PORT:-8000}"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
# Application Configuration
|
|
APP_ENVIRONMENT: ${APP_ENVIRONMENT:-development}
|
|
APP_VERSION: ${APP_VERSION:-0.1.0-dev}
|
|
APP_JWT_SECRET: ${APP_JWT_SECRET:-dev-secret-change-in-production}
|
|
|
|
# HTTP Server Configuration
|
|
SERVER_HOST: ${SERVER_HOST:-0.0.0.0}
|
|
SERVER_PORT: ${SERVER_PORT:-8000}
|
|
|
|
# Cassandra Database Configuration
|
|
# Connect to external infrastructure (use all 3 nodes in cluster)
|
|
DATABASE_HOSTS: ${DATABASE_HOSTS:-cassandra-1:9042,cassandra-2:9042,cassandra-3:9042}
|
|
DATABASE_KEYSPACE: ${DATABASE_KEYSPACE:-maplepress}
|
|
DATABASE_CONSISTENCY: ${DATABASE_CONSISTENCY:-ONE}
|
|
DATABASE_REPLICATION: ${DATABASE_REPLICATION:-3}
|
|
DATABASE_MIGRATIONS_PATH: ${DATABASE_MIGRATIONS_PATH:-file://migrations}
|
|
|
|
# Redis Cache Configuration
|
|
# Connect to external infrastructure
|
|
CACHE_HOST: ${CACHE_HOST:-redis}
|
|
CACHE_PORT: ${CACHE_PORT:-6379}
|
|
CACHE_PASSWORD: ${CACHE_PASSWORD:-}
|
|
CACHE_DB: ${CACHE_DB:-0}
|
|
|
|
# Meilisearch Configuration (if needed)
|
|
MEILISEARCH_HOST: ${MEILISEARCH_HOST:-http://meilisearch:7700}
|
|
MEILISEARCH_API_KEY: ${MEILISEARCH_API_KEY:-mapleopentech-dev-master-key-change-in-production}
|
|
|
|
# S3 Configuration (SeaweedFS - S3-compatible storage)
|
|
AWS_ACCESS_KEY: ${AWS_ACCESS_KEY:-any}
|
|
AWS_SECRET_KEY: ${AWS_SECRET_KEY:-any}
|
|
AWS_ENDPOINT: ${AWS_ENDPOINT:-http://seaweedfs:8333}
|
|
AWS_REGION: ${AWS_REGION:-us-east-1}
|
|
AWS_BUCKET_NAME: ${AWS_BUCKET_NAME:-maplepress}
|
|
|
|
# Logger Configuration
|
|
LOGGER_LEVEL: ${LOGGER_LEVEL:-debug}
|
|
LOGGER_FORMAT: ${LOGGER_FORMAT:-console}
|
|
|
|
# Leader Election Configuration
|
|
LEADER_ELECTION_ENABLED: ${LEADER_ELECTION_ENABLED:-true}
|
|
LEADER_ELECTION_LOCK_TTL: ${LEADER_ELECTION_LOCK_TTL:-10s}
|
|
LEADER_ELECTION_HEARTBEAT_INTERVAL: ${LEADER_ELECTION_HEARTBEAT_INTERVAL:-3s}
|
|
LEADER_ELECTION_RETRY_INTERVAL: ${LEADER_ELECTION_RETRY_INTERVAL:-2s}
|
|
|
|
volumes:
|
|
- ./:/go/src/codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend
|
|
networks:
|
|
- mapleopentech-dev
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"curl",
|
|
"-f",
|
|
"-H",
|
|
"X-Tenant-ID: healthcheck",
|
|
"http://localhost:${SERVER_PORT:-8000}/health",
|
|
]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|