In docker umgewandelt zwar mit erros im frontend aber ja
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
__pycache__
|
||||
*.pyc
|
||||
frontend/.env
|
||||
frontend/dist
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
# --- 1. Frontend bauen ---
|
||||
FROM node:20 AS frontend-build
|
||||
WORKDIR /app
|
||||
COPY frontend ./frontend
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install && npm run build
|
||||
|
||||
# --- 2. Backend-Stage ---
|
||||
FROM python:3.13
|
||||
WORKDIR /app
|
||||
|
||||
# Backend-Dateien korrekt kopieren
|
||||
COPY backend/app.py ./backend/app.py
|
||||
COPY backend/datenbankverbindung.py ./backend/datenbankverbindung.py
|
||||
COPY backend/templates ./backend/templates
|
||||
COPY backend/config ./config
|
||||
COPY backend/requirements.txt ./requirements.txt
|
||||
|
||||
# Frontend aus Build-Stage übernehmen
|
||||
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
|
||||
|
||||
# Python-Abhängigkeiten installieren
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Flask starten
|
||||
WORKDIR /app/backend
|
||||
EXPOSE 5000
|
||||
CMD ["python", "app.py"]
|
||||
+1
-1
@@ -157,4 +157,4 @@ def hash_md5():
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.makedirs("config", exist_ok=True)
|
||||
app.run(host='127.0.0.1', port=5000)
|
||||
app.run(host='0.0.0.0', port=5000)
|
||||
|
||||
@@ -3,3 +3,4 @@ flask-cors
|
||||
mysql-connector-python
|
||||
werkzeug>=2.3
|
||||
PyJWT
|
||||
python-dotenv
|
||||
Reference in New Issue
Block a user