multiple corrections on docker-compose and Dockerfile
robust start sequence avoid scrolling of main content
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
networks:
|
||||
infoscreen-net:
|
||||
driver: bridge
|
||||
@@ -18,19 +17,19 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- DB_URL=mysql+pymysql://${DB_USER}:${DB_PASSWORD}@db/${DB_NAME}
|
||||
volumes:
|
||||
- ./listener:/app:rw
|
||||
# 🔧 ENTFERNT: Volume-Mount ist nur für die Entwicklung
|
||||
networks:
|
||||
- infoscreen-net
|
||||
|
||||
proxy:
|
||||
image: nginx:stable
|
||||
image: nginx:1.25 # 🔧 GEÄNDERT: Spezifische Version
|
||||
container_name: infoscreen-proxy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ${PWD}/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ${PWD}/certs:/etc/nginx/certs:ro
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro # 🔧 GEÄNDERT: Relativer Pfad
|
||||
- ./certs:/etc/nginx/certs:ro # 🔧 GEÄNDERT: Relativer Pfad
|
||||
depends_on:
|
||||
- server
|
||||
- dashboard
|
||||
@@ -38,7 +37,7 @@ services:
|
||||
- infoscreen-net
|
||||
|
||||
db:
|
||||
image: mariadb:lts
|
||||
image: mariadb:11.2 # 🔧 GEÄNDERT: Spezifische Version
|
||||
container_name: infoscreen-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@@ -60,7 +59,7 @@ services:
|
||||
start_period: 30s
|
||||
|
||||
mqtt:
|
||||
image: eclipse-mosquitto:2.0.21
|
||||
image: eclipse-mosquitto:2.0.21 # ✅ GUT: Version ist bereits spezifisch
|
||||
container_name: infoscreen-mqtt
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
@@ -114,9 +113,8 @@ services:
|
||||
build:
|
||||
context: ./dashboard
|
||||
dockerfile: Dockerfile
|
||||
# ✅ HINZUGEFÜGT: Build-Args für React Production Build
|
||||
# 🔧 VEREINFACHT: Build-Args werden durch Umgebungsvariablen gesetzt
|
||||
args:
|
||||
- NODE_ENV=production
|
||||
- VITE_API_URL=${API_URL}
|
||||
image: infoscreen-dashboard:latest
|
||||
container_name: infoscreen-dashboard
|
||||
@@ -125,20 +123,20 @@ services:
|
||||
server:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# ✅ GEÄNDERT: React-spezifische Umgebungsvariablen
|
||||
- VITE_API_URL=${API_URL}
|
||||
- NODE_ENV=production
|
||||
ports:
|
||||
- "3000:3000" # ✅ GEÄNDERT: Standard React/Vite Port
|
||||
- VITE_API_URL=${API_URL}
|
||||
# 🔧 ENTFERNT: Port wird in Produktion nicht direkt freigegeben, Zugriff via Proxy
|
||||
networks:
|
||||
- infoscreen-net
|
||||
# ✅ GEÄNDERT: Healthcheck für React App
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
|
||||
# 🔧 GEÄNDERT: Healthcheck prüft den Nginx-Server im Container
|
||||
test: ["CMD", "curl", "-f", "http://localhost/"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
# 🔧 ERHÖHT: Gibt dem Backend mehr Zeit zum Starten, bevor dieser
|
||||
# Container als "gesund" markiert wird.
|
||||
start_period: 60s
|
||||
|
||||
scheduler:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user