KagChi commited on
Commit
3524dd5
·
verified ·
1 Parent(s): 40a49ec

chore: update

Browse files
Files changed (1) hide show
  1. 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 file
33
- RUN mkdir -p /models && chown user:user /models && curl https://s3.tebi.io/models/model.pkl -o /models/model.pkl && curl https://s3.tebi.io/models/tokenizer.pkl -o /models/tokenizer.pkl
34
-
35
 
36
- # Run your app with uvicorn (update if entry point is different)
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"]