Spaces:
Runtime error
Runtime error
chore: update
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
# Use official Python 3.12 base image
|
| 2 |
FROM python:3.12
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
# Create a non-root user and switch to it
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
USER user
|
|
@@ -29,9 +32,9 @@ COPY --chown=user . .
|
|
| 29 |
# Expose port
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
# Download the model
|
| 33 |
-
RUN
|
| 34 |
-
|
| 35 |
|
| 36 |
-
# Run your app
|
| 37 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Use official Python 3.12 base image
|
| 2 |
FROM python:3.12
|
| 3 |
|
| 4 |
+
# Create /models directory and set ownership before switching user
|
| 5 |
+
RUN mkdir -p /models && chown 1000:1000 /models
|
| 6 |
+
|
| 7 |
# Create a non-root user and switch to it
|
| 8 |
RUN useradd -m -u 1000 user
|
| 9 |
USER user
|
|
|
|
| 32 |
# Expose port
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
+
# Download the model files (now that /models is writable)
|
| 36 |
+
RUN curl https://s3.tebi.io/models/model.pkl -o /models/model.pkl && \
|
| 37 |
+
curl https://s3.tebi.io/models/tokenizer.pkl -o /models/tokenizer.pkl
|
| 38 |
|
| 39 |
+
# Run your app
|
| 40 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|