mirror of
https://github.com/ferdzo/iotDashboard.git
synced 2026-04-05 09:06:26 +00:00
Updates and fixes.
This commit is contained in:
129
infrastructure/compose.prod.yml
Normal file
129
infrastructure/compose.prod.yml
Normal file
@@ -0,0 +1,129 @@
|
||||
services:
|
||||
|
||||
redis:
|
||||
image: redis:8
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
restart: unless-stopped
|
||||
|
||||
mosquitto:
|
||||
image: eclipse-mosquitto:2.0
|
||||
ports:
|
||||
- "1883:1883"
|
||||
- "9001:9001"
|
||||
- "8883:8883"
|
||||
volumes:
|
||||
- ./mosquitto/:/mosquitto/:Z
|
||||
restart: unless-stopped
|
||||
|
||||
timescaledb:
|
||||
image: timescale/timescaledb:latest-pg17
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-example}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-iot_data}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- timescaledb-data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
device-manager:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis/device-manager:latest
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-example}@timescaledb:5432/${POSTGRES_DB:-iot_data}
|
||||
- CA_CERT_PATH=/app/certs/ca.crt
|
||||
- CA_KEY_PATH=/app/certs/ca.key
|
||||
- CRL_PATH=/app/certs/ca.crl
|
||||
volumes:
|
||||
- ./mosquitto/certs:/app/certs:z
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
mqtt-ingestion:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis/mqtt-ingestion:latest
|
||||
environment:
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_DB=0
|
||||
- MQTT_BROKER=mosquitto
|
||||
- MQTT_PORT=1883
|
||||
- MQTT_USER=${MQTT_USER:-}
|
||||
- MQTT_PASS=${MQTT_PASS:-}
|
||||
depends_on:
|
||||
- mosquitto
|
||||
- redis
|
||||
restart: unless-stopped
|
||||
|
||||
db-write:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis/db-write:latest
|
||||
environment:
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_DB=0
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-example}@timescaledb:5432/${POSTGRES_DB:-iot_data}
|
||||
- CONSUMER_GROUP_NAME=db_writer
|
||||
- CONSUMER_NAME=worker-01
|
||||
- BATCH_SIZE=100
|
||||
- BATCH_TIMEOUT_SEC=5
|
||||
- STREAM_PATTERN=mqtt_stream:*
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
mqtt-ingestion:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
|
||||
backend:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis/backend:latest
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- POSTGRES_HOST=timescaledb
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-example}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-iot_data}
|
||||
- DEVICE_MANAGER_URL=http://device-manager:8000
|
||||
- SECRET_KEY=${SECRET_KEY:-change-me-in-production}
|
||||
- DEBUG=False
|
||||
- ALLOWED_HOSTS=*
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
device-manager:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis/frontend:latest
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
gpt-service:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis-gpt-service:latest
|
||||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
ports:
|
||||
- "8001:8001"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
redis-data:
|
||||
timescaledb-data:
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
- "9001:9001"
|
||||
- "8883:8883"
|
||||
volumes:
|
||||
- ./mosquitto/:/mosquitto/:Z
|
||||
- ./mosquitto/:/mosquitto/
|
||||
restart: unless-stopped
|
||||
|
||||
timescaledb:
|
||||
@@ -29,19 +29,26 @@ services:
|
||||
volumes:
|
||||
- timescaledb-data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
db-write:
|
||||
build:
|
||||
context: ../services/db_write
|
||||
device-manager:
|
||||
build:
|
||||
context: ../services/device_manager
|
||||
ports:
|
||||
- "8000:8000"
|
||||
env_file:
|
||||
- .env.dbw
|
||||
- ../services/device_manager/.env
|
||||
volumes:
|
||||
- ./mosquitto/certs:/app/certs:z
|
||||
depends_on:
|
||||
- timescaledb
|
||||
- redis
|
||||
- mqtt-ingestion
|
||||
restart:
|
||||
unless-stopped
|
||||
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
mqtt-ingestion:
|
||||
build:
|
||||
context: ../services/mqtt_ingestion
|
||||
@@ -50,18 +57,66 @@ services:
|
||||
depends_on:
|
||||
- mosquitto
|
||||
- redis
|
||||
restart:
|
||||
unless-stopped
|
||||
restart: unless-stopped
|
||||
|
||||
# gpt-service:
|
||||
# build:
|
||||
# context: ./services/gpt_service
|
||||
# ports:
|
||||
# - "8001:8001"
|
||||
# restart: unless-stopped
|
||||
db-write:
|
||||
build:
|
||||
context: ../services/db_write
|
||||
env_file:
|
||||
- .env.dbw
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
mqtt-ingestion:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
|
||||
backend:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis/backend:latest
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- POSTGRES_HOST=timescaledb
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-example}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-iot_data}
|
||||
- DEVICE_MANAGER_URL=http://device-manager:8000
|
||||
- SECRET_KEY=${SECRET_KEY:-change-me-in-production}6
|
||||
- DEBUG=False
|
||||
- ALLOWED_HOSTS=*
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
device-manager:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ../frontend
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_URL: /api
|
||||
VITE_DEVICE_MANAGER_URL: ${VITE_DEVICE_MANAGER_URL:-http://localhost/api}
|
||||
VITE_MQTT_BROKER: ${VITE_MQTT_BROKER:-localhost}
|
||||
VITE_MQTT_PORT: ${VITE_MQTT_PORT:-8883}
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- django
|
||||
restart: unless-stopped
|
||||
|
||||
gpt-service:
|
||||
image: git.ferdzo.xyz/ferdzo/lyncis-gpt-service:latest
|
||||
environment:
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
ports:
|
||||
- "8001:8001"
|
||||
restart: unless-stopped
|
||||
|
||||
|
||||
|
||||
volumes:
|
||||
redis-data:
|
||||
|
||||
Reference in New Issue
Block a user