Script zum direkten deployen von docker-compose
Footer-Zeilen hinzugefügt watchtower dazu
This commit is contained in:
31
deploy-compose.sh
Executable file
31
deploy-compose.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Deploy docker-compose.prod.yml to strato_1 server
|
||||||
|
|
||||||
|
TARGET_HOST="strato_1"
|
||||||
|
TARGET_DIR="/opt/stacks/wetter"
|
||||||
|
TARGET_FILE="compose.yml"
|
||||||
|
SOURCE_FILE="docker-compose.prod.yml"
|
||||||
|
|
||||||
|
echo "Deploying ${SOURCE_FILE} to ${TARGET_HOST}:${TARGET_DIR}/${TARGET_FILE}..."
|
||||||
|
|
||||||
|
# Check if source file exists
|
||||||
|
if [ ! -f "${SOURCE_FILE}" ]; then
|
||||||
|
echo "Error: ${SOURCE_FILE} not found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove old compose.yml on target if it exists
|
||||||
|
echo "Removing old ${TARGET_FILE} on ${TARGET_HOST}..."
|
||||||
|
ssh "${TARGET_HOST}" "rm -f ${TARGET_DIR}/${TARGET_FILE}"
|
||||||
|
|
||||||
|
# Copy the file
|
||||||
|
echo "Copying ${SOURCE_FILE} to ${TARGET_HOST}..."
|
||||||
|
scp "${SOURCE_FILE}" "${TARGET_HOST}:${TARGET_DIR}/${TARGET_FILE}"
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "✓ Successfully deployed ${TARGET_FILE} to ${TARGET_HOST}:${TARGET_DIR}/"
|
||||||
|
else
|
||||||
|
echo "✗ Deployment failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -32,6 +32,7 @@ services:
|
|||||||
- internal
|
- internal
|
||||||
- proxy
|
- proxy
|
||||||
labels:
|
labels:
|
||||||
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=dockge_default"
|
- "traefik.docker.network=dockge_default"
|
||||||
- "traefik.http.routers.wetterstation-collector.rule=Host(`stwwetter.fuerst-stuttgart.de`) && PathPrefix(`/collector`)"
|
- "traefik.http.routers.wetterstation-collector.rule=Host(`stwwetter.fuerst-stuttgart.de`) && PathPrefix(`/collector`)"
|
||||||
@@ -57,6 +58,7 @@ services:
|
|||||||
- internal
|
- internal
|
||||||
- proxy
|
- proxy
|
||||||
labels:
|
labels:
|
||||||
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=dockge_default"
|
- "traefik.docker.network=dockge_default"
|
||||||
- "traefik.http.routers.wetterstation-api.rule=Host(`stwwetter.fuerst-stuttgart.de`) && PathPrefix(`/api`)"
|
- "traefik.http.routers.wetterstation-api.rule=Host(`stwwetter.fuerst-stuttgart.de`) && PathPrefix(`/api`)"
|
||||||
@@ -77,6 +79,7 @@ services:
|
|||||||
- internal
|
- internal
|
||||||
- proxy
|
- proxy
|
||||||
labels:
|
labels:
|
||||||
|
- "com.centurylinklabs.watchtower.enable=true"
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=dockge_default"
|
- "traefik.docker.network=dockge_default"
|
||||||
- "traefik.http.routers.wetterstation.rule=Host(`stwwetter.fuerst-stuttgart.de`)"
|
- "traefik.http.routers.wetterstation.rule=Host(`stwwetter.fuerst-stuttgart.de`)"
|
||||||
@@ -85,6 +88,21 @@ services:
|
|||||||
- "traefik.http.routers.wetterstation.tls.certresolver=letsencrypt"
|
- "traefik.http.routers.wetterstation.tls.certresolver=letsencrypt"
|
||||||
- "traefik.http.services.wetterstation.loadbalancer.server.port=80"
|
- "traefik.http.services.wetterstation.loadbalancer.server.port=80"
|
||||||
|
|
||||||
|
watchtower:
|
||||||
|
image: containrrr/watchtower:latest
|
||||||
|
container_name: wetterstation_watchtower
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
environment:
|
||||||
|
- WATCHTOWER_CLEANUP=true
|
||||||
|
- WATCHTOWER_LABEL_ENABLE=true
|
||||||
|
- WATCHTOWER_INCLUDE_RESTARTING=true
|
||||||
|
- WATCHTOWER_POLL_INTERVAL=300
|
||||||
|
- TZ=Europe/Berlin
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
name: wetterstation_postgres_data_prod
|
name: wetterstation_postgres_data_prod
|
||||||
|
|||||||
@@ -65,3 +65,46 @@
|
|||||||
color: #666;
|
color: #666;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dashboard-footer {
|
||||||
|
margin-top: 2rem;
|
||||||
|
padding-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-divider {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
margin: 0 0 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-credits {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-left {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-sponsor {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-sponsor a {
|
||||||
|
color: #0066cc;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-sponsor a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|||||||
@@ -426,6 +426,18 @@ const WeatherDashboard = ({ data }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Footer */}
|
||||||
|
<div className="dashboard-footer">
|
||||||
|
<hr className="footer-divider" />
|
||||||
|
<div className="footer-credits">
|
||||||
|
<div className="footer-left">Daten-Erfassung mit einer Davis VantagePro.</div>
|
||||||
|
<div className="footer-right">Grafiken erzeugt mit HighCharts</div>
|
||||||
|
</div>
|
||||||
|
<div className="footer-sponsor">
|
||||||
|
Die Wetterstation wurde vom Zeitungsverlag Waiblingen <a href="https://www.zvw.de" target="_blank" rel="noopener noreferrer">www.zvw.de</a> gestiftet.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user