ADD: sites and architecture module fix

This commit is contained in:
2026-06-07 18:11:02 +01:00
parent f51d5755c2
commit c3fbb0b9da
2 changed files with 9 additions and 16 deletions

View File

@@ -14,5 +14,6 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt flask psutil RUN pip install --no-cache-dir -r requirements.txt flask psutil
COPY . . COPY . .
EXPOSE 8000
EXPOSE 5000
CMD ["python", "app.py"] CMD ["python", "app.py"]

12
platform/Jenkinsfile vendored
View File

@@ -21,14 +21,8 @@ pipeline {
stage('Deploy to Server 1') { stage('Deploy to Server 1') {
steps { steps {
sh ''' sh '''
# Sync Python modules to host path — docker run mounts this OVER the image
# (new app.py in the image imports modules.sites etc.; host must stay in sync)
mkdir -p /root/management-platform/modules
cp -f ./platform/modules/*.py /root/management-platform/modules/
echo "✅ Synced platform/modules → /root/management-platform/modules"
docker stop management-platform 2>/dev/null || true docker stop management-platform 2>/dev/null || true
docker rm management-platform 2>/dev/null || true docker rm management-platform 2>/dev/null || true
docker run -d \ docker run -d \
--name management-platform \ --name management-platform \
@@ -40,7 +34,6 @@ pipeline {
-v /etc/passwd:/etc/passwd:ro \ -v /etc/passwd:/etc/passwd:ro \
-v /etc/shadow:/etc/shadow:ro \ -v /etc/shadow:/etc/shadow:ro \
-v /root/management-platform/config.py:/app/config.py:ro \ -v /root/management-platform/config.py:/app/config.py:ro \
-v /root/management-platform/modules:/app/modules:ro \
management-platform:latest management-platform:latest
sleep 5 sleep 5
@@ -49,7 +42,7 @@ pipeline {
echo "✅ Deployed successfully" echo "✅ Deployed successfully"
else else
echo "❌ Container failed to start" echo "❌ Container failed to start"
docker logs management-platform --tail=20 docker logs management-platform --tail=30
exit 1 exit 1
fi fi
''' '''
@@ -60,7 +53,6 @@ pipeline {
steps { steps {
sh ''' sh '''
sleep 3 sleep 3
# /login is public; / redirects and may not satisfy curl -f in all setups
if curl -sf http://localhost:8088/login 2>/dev/null; then if curl -sf http://localhost:8088/login 2>/dev/null; then
echo "✅ Platform responding on :8088" echo "✅ Platform responding on :8088"
else else