arithescientist commited on
Commit
b8d230f
·
verified ·
1 Parent(s): d5b66f7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -1,23 +1,24 @@
1
  FROM python:3.11.0
2
 
 
3
  RUN apt-get update && apt-get install -y git-lfs && git lfs install
4
 
5
  # Create non-root user
6
  RUN useradd -m -u 1000 user
7
  WORKDIR /app
8
 
9
- # Copy dependencies and install
10
  COPY --chown=user requirements.txt requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
- RUN python -m textblob.download_corpora
13
 
14
  # Copy application code
15
  COPY --chown=user . /app
16
 
 
17
  RUN git lfs pull || echo 'No LFS to pull'
18
 
19
  # Expose Flask port
20
  EXPOSE 7860
21
 
22
- # Run the app
23
- CMD ["python", "app.py"]
 
1
  FROM python:3.11.0
2
 
3
+ # Install git-lfs and update
4
  RUN apt-get update && apt-get install -y git-lfs && git lfs install
5
 
6
  # Create non-root user
7
  RUN useradd -m -u 1000 user
8
  WORKDIR /app
9
 
10
+ # Copy and install dependencies
11
  COPY --chown=user requirements.txt requirements.txt
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
13
 
14
  # Copy application code
15
  COPY --chown=user . /app
16
 
17
+ # Pull LFS content (if any)
18
  RUN git lfs pull || echo 'No LFS to pull'
19
 
20
  # Expose Flask port
21
  EXPOSE 7860
22
 
23
+ # Run textblob corpora download at container startup
24
+ CMD ["sh", "-c", "python -m textblob.download_corpora && python app.py"]