nvd commited on
Update Dockerfile
Browse files- Dockerfile +17 -5
Dockerfile
CHANGED
|
@@ -1,6 +1,18 @@
|
|
| 1 |
FROM python:3.9
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
RUN
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
# Set up a new user to avoid permission issues with the .session file
|
| 4 |
+
RUN useradd -m -u 1000 user
|
| 5 |
+
USER user
|
| 6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 7 |
+
|
| 8 |
+
WORKDIR /home/user/app
|
| 9 |
+
|
| 10 |
+
# Install dependencies
|
| 11 |
+
COPY --chown=user requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy the rest of the files
|
| 15 |
+
COPY --chown=user . .
|
| 16 |
+
|
| 17 |
+
# Hugging Face runs on port 7860
|
| 18 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|