Initial Plast Track MVP
This commit is contained in:
74
docker-compose.yml
Normal file
74
docker-compose.yml
Normal file
@@ -0,0 +1,74 @@
|
||||
services:
|
||||
database:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_DB: plasttrack
|
||||
POSTGRES_USER: plasttrack
|
||||
POSTGRES_PASSWORD: plasttrack
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./database/init.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
|
||||
- ./database/seed.sql:/docker-entrypoint-initdb.d/02-seed.sql:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U plasttrack -d plasttrack"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
|
||||
mqtt:
|
||||
image: eclipse-mosquitto:2
|
||||
ports:
|
||||
- "1883:1883"
|
||||
- "9001:9001"
|
||||
volumes:
|
||||
- ./mqtt/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mosquitto_sub -h localhost -p 1883 -t '$$SYS/broker/version' -C 1 -W 3 >/dev/null 2>&1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
environment:
|
||||
DATABASE_URL: postgresql+psycopg://plasttrack:plasttrack@database:5432/plasttrack
|
||||
MQTT_HOST: mqtt
|
||||
MQTT_PORT: 1883
|
||||
MQTT_TOPIC: plasttrack/machines/+/events
|
||||
FRONTEND_ORIGIN: http://localhost:5173
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
mqtt:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
edge-simulator:
|
||||
build:
|
||||
context: ./edge-simulator
|
||||
environment:
|
||||
MQTT_HOST: mqtt
|
||||
MQTT_PORT: 1883
|
||||
MQTT_TOPIC_PREFIX: plasttrack/machines
|
||||
SIM_MACHINE_CODES: INJ-01,INJ-02,INJ-03
|
||||
depends_on:
|
||||
mqtt:
|
||||
condition: service_healthy
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
environment:
|
||||
VITE_API_BASE_URL: http://localhost:8000
|
||||
VITE_WS_URL: ws://localhost:8000/ws/dashboard
|
||||
depends_on:
|
||||
- backend
|
||||
ports:
|
||||
- "5173:5173"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user