Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10
|
| 2 |
+
|
| 3 |
+
# User setup für Hugging Face Security
|
| 4 |
+
user root
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# Dependencies installieren
|
| 12 |
+
COPY --chown=user:user requirements.txt requirements.txt
|
| 13 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Ordnerstruktur für Templates erstellen (wie im Code erwartet)
|
| 16 |
+
RUN mkdir -p experiments/templates
|
| 17 |
+
|
| 18 |
+
# Dateien kopieren
|
| 19 |
+
# 1. Die Core-Logik (muss exakt so heißen wegen importlib im Code)
|
| 20 |
+
COPY --chown=user:user 1014ecaa4_scimind2_communicator.py 1014ecaa4_scimind2_communicator.py
|
| 21 |
+
|
| 22 |
+
# 2. Die App (umbenannt zu app.py für Konvention, Inhalt ist input_file_1.py)
|
| 23 |
+
COPY --chown=user:user app.py app.py
|
| 24 |
+
|
| 25 |
+
# 3. Das HTML Template (muss in den Unterordner und exakt so heißen)
|
| 26 |
+
COPY --chown=user:user experiments/templates/1014ecaa4_index.html experiments/templates/1014ecaa4_index.html
|
| 27 |
+
|
| 28 |
+
# Startbefehl: Überschreibt den __main__ Block im Code, um Port 7860 zu nutzen
|
| 29 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|