Commit
·
cef3a32
1
Parent(s):
6cc1403
docker
Browse files- Dockerfile +3 -15
Dockerfile
CHANGED
@@ -1,25 +1,13 @@
|
|
1 |
-
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.10-slim
|
3 |
-
|
4 |
-
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
-
|
7 |
-
# Copy the requirements file into the container at /app
|
8 |
COPY requirements.txt /app/
|
9 |
-
|
10 |
-
# Install any needed packages specified in requirements.txt
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
-
|
13 |
-
# Copy the current directory contents into the container at /app
|
14 |
COPY . /app/
|
15 |
-
|
16 |
-
# Create a directory for file uploads and set permissions
|
17 |
-
# Using chown for better security (assuming UID/GID 1000:1000)
|
18 |
-
# If this doesn't work, you might need to try chmod 777, but chown is preferred.
|
19 |
RUN mkdir -p /app/uploads && chown -R 1000:1000 /app/uploads
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
|
|
|
24 |
# Run app.py when the container launches
|
25 |
CMD ["python", "app.py"]
|
|
|
|
|
1 |
FROM python:3.10-slim
|
|
|
|
|
2 |
WORKDIR /app
|
|
|
|
|
3 |
COPY requirements.txt /app/
|
|
|
|
|
4 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
5 |
COPY . /app/
|
|
|
|
|
|
|
|
|
6 |
RUN mkdir -p /app/uploads && chown -R 1000:1000 /app/uploads
|
7 |
|
8 |
+
# Set HF_HOME to a writable directory *inside* your /app
|
9 |
+
ENV HF_HOME=/app/.cache
|
10 |
|
11 |
+
EXPOSE 7860
|
12 |
# Run app.py when the container launches
|
13 |
CMD ["python", "app.py"]
|