Spaces:
Building
Building
muzammil-eds
commited on
Commit
•
225a76f
1
Parent(s):
92fc72f
Files added
Browse files- Dockerfile +10 -8
Dockerfile
CHANGED
@@ -1,29 +1,31 @@
|
|
1 |
# Use an official Python runtime as the base image
|
2 |
-
FROM python:3.12.3
|
3 |
LABEL authors="muzammil"
|
4 |
|
5 |
# Set Hugging Face cache directory to /tmp/.cache (which should be writable)
|
6 |
ENV HF_HOME="/tmp/.cache"
|
7 |
|
8 |
-
# Install FFmpeg
|
9 |
-
RUN apt-get update && apt-get install -y ffmpeg
|
10 |
-
|
|
|
11 |
|
|
|
12 |
RUN useradd -m -u 1000 user
|
13 |
USER user
|
14 |
ENV HOME=/home/user \
|
15 |
-
|
16 |
|
17 |
WORKDIR $HOME/app
|
18 |
|
|
|
19 |
COPY --chown=user . $HOME/app
|
20 |
|
21 |
-
|
22 |
# Install any required Python dependencies
|
23 |
RUN pip install --no-cache-dir -r requirements.txt
|
24 |
|
25 |
-
# Expose the port
|
26 |
EXPOSE 7860
|
27 |
|
28 |
-
# Command to run app
|
29 |
CMD ["python3", "app.py"]
|
|
|
1 |
# Use an official Python runtime as the base image
|
2 |
+
FROM python:3.12.3-slim # Slim version for a smaller image size
|
3 |
LABEL authors="muzammil"
|
4 |
|
5 |
# Set Hugging Face cache directory to /tmp/.cache (which should be writable)
|
6 |
ENV HF_HOME="/tmp/.cache"
|
7 |
|
8 |
+
# Install FFmpeg and other necessary dependencies
|
9 |
+
RUN apt-get update && apt-get install -y ffmpeg && \
|
10 |
+
apt-get clean && \
|
11 |
+
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Create a user with a specific UID for permissions handling
|
14 |
RUN useradd -m -u 1000 user
|
15 |
USER user
|
16 |
ENV HOME=/home/user \
|
17 |
+
PATH=/home/user/.local/bin:$PATH
|
18 |
|
19 |
WORKDIR $HOME/app
|
20 |
|
21 |
+
# Copy the current directory contents into the container
|
22 |
COPY --chown=user . $HOME/app
|
23 |
|
|
|
24 |
# Install any required Python dependencies
|
25 |
RUN pip install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
+
# Expose the port for Gradio app (usually runs on 7860 by default)
|
28 |
EXPOSE 7860
|
29 |
|
30 |
+
# Command to run the Gradio app
|
31 |
CMD ["python3", "app.py"]
|