Spaces:
Sleeping
Sleeping
Update Dockerfile
#1
by
2cylu2 - opened
- Dockerfile +4 -4
Dockerfile
CHANGED
|
@@ -5,22 +5,22 @@ RUN apt-get update && \
|
|
| 5 |
apt-get install -y ffmpeg libsndfile1 git-lfs && \
|
| 6 |
git lfs install
|
| 7 |
|
| 8 |
-
# Create user
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
| 11 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
-
# Copy requirements first (
|
| 16 |
COPY --chown=user requirements.txt requirements.txt
|
| 17 |
|
| 18 |
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
-
# Copy
|
| 22 |
COPY --chown=user . /app
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
CMD ["
|
|
|
|
| 5 |
apt-get install -y ffmpeg libsndfile1 git-lfs && \
|
| 6 |
git lfs install
|
| 7 |
|
| 8 |
+
# Create non-root user
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
| 11 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
+
# Copy requirements first (better Docker caching)
|
| 16 |
COPY --chown=user requirements.txt requirements.txt
|
| 17 |
|
| 18 |
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
+
# Copy entire repo (including pyharp folder)
|
| 22 |
COPY --chown=user . /app
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
+
CMD ["python", "app.py"]
|