feat: initial KosmoConnect platform v0.1
Includes: - Backend services: ingestion (:8001), weather API (:8002), gateway (:8003), billing (:8004) with BTCPay integration - Shared asyncpg pool, TimescaleDB hypertable, Redis, Mosquitto MQTT - React frontend: Dashboard (MapLibre) and Messaging (chat UI) - Bridge daemon for Pi + Meshtastic (Serial/TCP T-Deck support) - Production Docker Compose, Nginx reverse proxy, ops scripts - DEPLOY.md with step-by-step deployment guide
This commit is contained in:
129
backend/docker-compose.prod.yml
Normal file
129
backend/docker-compose.prod.yml
Normal file
@@ -0,0 +1,129 @@
|
||||
services:
|
||||
timescaledb:
|
||||
image: timescale/timescaledb:latest-pg15
|
||||
container_name: kosmo_timescaledb
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-kosmo}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-kosmoconnect}
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432"
|
||||
volumes:
|
||||
- timescale_data:/var/lib/postgresql/data
|
||||
- ./migrations:/docker-entrypoint-initdb.d
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-kosmo} -d ${POSTGRES_DB:-kosmoconnect}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: kosmo_redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
|
||||
mosquitto:
|
||||
image: eclipse-mosquitto:2
|
||||
container_name: kosmo_mosquitto
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:1883:1883"
|
||||
volumes:
|
||||
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
|
||||
- mosquitto_data:/mosquitto/data
|
||||
|
||||
api:
|
||||
build: .
|
||||
container_name: kosmo_api
|
||||
restart: unless-stopped
|
||||
command: ["uvicorn", "api.src.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
MQTT_HOST: ${MQTT_HOST:-mosquitto}
|
||||
MQTT_PORT: ${MQTT_PORT:-1883}
|
||||
ports:
|
||||
- "127.0.0.1:8002:8000"
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
mosquitto:
|
||||
condition: service_started
|
||||
|
||||
ingestion:
|
||||
build: .
|
||||
container_name: kosmo_ingestion
|
||||
restart: unless-stopped
|
||||
command: ["uvicorn", "ingestion.src.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
MQTT_HOST: ${MQTT_HOST:-mosquitto}
|
||||
MQTT_PORT: ${MQTT_PORT:-1883}
|
||||
MQTT_TOPIC: ${MQTT_TOPIC:-kosmo/ingest/enviro}
|
||||
ports:
|
||||
- "127.0.0.1:8001:8000"
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
mosquitto:
|
||||
condition: service_started
|
||||
|
||||
gateway:
|
||||
build: .
|
||||
container_name: kosmo_gateway
|
||||
restart: unless-stopped
|
||||
command: ["uvicorn", "gateway.src.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
MQTT_HOST: ${MQTT_HOST:-mosquitto}
|
||||
MQTT_PORT: ${MQTT_PORT:-1883}
|
||||
ports:
|
||||
- "127.0.0.1:8003:8000"
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
mosquitto:
|
||||
condition: service_started
|
||||
|
||||
billing:
|
||||
build: .
|
||||
container_name: kosmo_billing
|
||||
restart: unless-stopped
|
||||
command: ["uvicorn", "billing.src.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
BTCPAY_URL: ${BTCPAY_URL}
|
||||
BTCPAY_API_KEY: ${BTCPAY_API_KEY}
|
||||
BTCPAY_STORE_ID: ${BTCPAY_STORE_ID}
|
||||
WEBHOOK_SECRET: ${WEBHOOK_SECRET}
|
||||
ports:
|
||||
- "127.0.0.1:8004:8000"
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: kosmo_nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ../web/dashboard/dist:/usr/share/nginx/html/dashboard:ro
|
||||
- ../web/messaging/dist:/usr/share/nginx/html/messaging:ro
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ./certs:/etc/nginx/certs:ro
|
||||
depends_on:
|
||||
- api
|
||||
- gateway
|
||||
- billing
|
||||
|
||||
volumes:
|
||||
timescale_data:
|
||||
redis_data:
|
||||
mosquitto_data:
|
||||
Reference in New Issue
Block a user