Prathamesh Bhamare commited on
Commit ·
ffe2ac5
1
Parent(s): ef93e74
Fix permissions on HF Spaces by chowning copied files to user 1000
Browse files- Dockerfile +10 -10
- Dockerfile.hf +11 -11
Dockerfile
CHANGED
|
@@ -20,21 +20,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 20 |
curl \
|
| 21 |
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
-
COPY requirements.txt .
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
# Copy application code
|
| 27 |
-
COPY agents/ ./agents/
|
| 28 |
-
COPY api/ ./api/
|
| 29 |
-
COPY ml/ ./ml/
|
| 30 |
-
COPY data/ ./data/
|
| 31 |
-
COPY scripts/ ./scripts/
|
| 32 |
-
COPY ui/ ./ui/
|
| 33 |
-
COPY run_api.py run_all.py ./
|
| 34 |
|
| 35 |
# Copy pre-trained model artifacts and data
|
| 36 |
-
COPY data_output/ ./data_output/
|
| 37 |
-
COPY mlruns/ ./mlruns/
|
| 38 |
|
| 39 |
# HF Spaces expects port 7860
|
| 40 |
EXPOSE 7860
|
|
|
|
| 20 |
curl \
|
| 21 |
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
+
COPY --chown=1000:1000 requirements.txt .
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
# Copy application code
|
| 27 |
+
COPY --chown=1000:1000 agents/ ./agents/
|
| 28 |
+
COPY --chown=1000:1000 api/ ./api/
|
| 29 |
+
COPY --chown=1000:1000 ml/ ./ml/
|
| 30 |
+
COPY --chown=1000:1000 data/ ./data/
|
| 31 |
+
COPY --chown=1000:1000 scripts/ ./scripts/
|
| 32 |
+
COPY --chown=1000:1000 ui/ ./ui/
|
| 33 |
+
COPY --chown=1000:1000 run_api.py run_all.py ./
|
| 34 |
|
| 35 |
# Copy pre-trained model artifacts and data
|
| 36 |
+
COPY --chown=1000:1000 data_output/ ./data_output/
|
| 37 |
+
COPY --chown=1000:1000 mlruns/ ./mlruns/
|
| 38 |
|
| 39 |
# HF Spaces expects port 7860
|
| 40 |
EXPOSE 7860
|
Dockerfile.hf
CHANGED
|
@@ -21,22 +21,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 21 |
supervisor \
|
| 22 |
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
-
COPY requirements.txt .
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
# Copy application code
|
| 28 |
-
COPY agents/ ./agents/
|
| 29 |
-
COPY api/ ./api/
|
| 30 |
-
COPY ml/ ./ml/
|
| 31 |
-
COPY data/ ./data/
|
| 32 |
-
COPY scripts/ ./scripts/
|
| 33 |
-
COPY ui/ ./ui/
|
| 34 |
-
COPY run_api.py run_all.py ./
|
| 35 |
|
| 36 |
# Copy pre-trained model artifacts and data
|
| 37 |
-
COPY data_output/ ./data_output/
|
| 38 |
-
COPY mlruns/ ./mlruns/
|
| 39 |
-
COPY mlflow.db ./mlflow.db
|
| 40 |
|
| 41 |
# Supervisor config — runs FastAPI on 7860 (HF's expected port)
|
| 42 |
RUN cat > /etc/supervisor/conf.d/kronector.conf << 'EOF'
|
|
|
|
| 21 |
supervisor \
|
| 22 |
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
+
COPY --chown=1000:1000 requirements.txt .
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
# Copy application code
|
| 28 |
+
COPY --chown=1000:1000 agents/ ./agents/
|
| 29 |
+
COPY --chown=1000:1000 api/ ./api/
|
| 30 |
+
COPY --chown=1000:1000 ml/ ./ml/
|
| 31 |
+
COPY --chown=1000:1000 data/ ./data/
|
| 32 |
+
COPY --chown=1000:1000 scripts/ ./scripts/
|
| 33 |
+
COPY --chown=1000:1000 ui/ ./ui/
|
| 34 |
+
COPY --chown=1000:1000 run_api.py run_all.py ./
|
| 35 |
|
| 36 |
# Copy pre-trained model artifacts and data
|
| 37 |
+
COPY --chown=1000:1000 data_output/ ./data_output/
|
| 38 |
+
COPY --chown=1000:1000 mlruns/ ./mlruns/
|
| 39 |
+
COPY --chown=1000:1000 mlflow.db ./mlflow.db
|
| 40 |
|
| 41 |
# Supervisor config — runs FastAPI on 7860 (HF's expected port)
|
| 42 |
RUN cat > /etc/supervisor/conf.d/kronector.conf << 'EOF'
|