Refactor : pdf access
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -3,22 +3,25 @@
|
|
| 3 |
|
| 4 |
FROM python:3.9
|
| 5 |
|
| 6 |
-
|
| 7 |
WORKDIR /code
|
| 8 |
|
|
|
|
| 9 |
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
# Set the HF_HOME environment variable
|
| 12 |
ENV HF_HOME /code/.cache/huggingface
|
| 13 |
|
| 14 |
# Create cache directory with appropriate permissions
|
| 15 |
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
# Grant write permissions to the directory where your application saves files
|
| 18 |
RUN mkdir -p /code/static/uploads && chmod -R 777 /code/static/uploads
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
COPY . .
|
| 23 |
-
|
| 24 |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|
|
|
|
| 3 |
|
| 4 |
FROM python:3.9
|
| 5 |
|
|
|
|
| 6 |
WORKDIR /code
|
| 7 |
|
| 8 |
+
# Copy requirements.txt separately to leverage Docker layer caching
|
| 9 |
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
|
| 11 |
+
# Install dependencies
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
+
|
| 14 |
# Set the HF_HOME environment variable
|
| 15 |
ENV HF_HOME /code/.cache/huggingface
|
| 16 |
|
| 17 |
# Create cache directory with appropriate permissions
|
| 18 |
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
|
| 19 |
|
| 20 |
+
# Copy the rest of the application files
|
| 21 |
+
COPY . .
|
| 22 |
+
|
| 23 |
# Grant write permissions to the directory where your application saves files
|
| 24 |
RUN mkdir -p /code/static/uploads && chmod -R 777 /code/static/uploads
|
| 25 |
|
| 26 |
+
# Command to run your application
|
|
|
|
|
|
|
|
|
|
| 27 |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|