Jobsforce commited on
Commit
3ce87fe
·
verified ·
1 Parent(s): 7ce0eb4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -7
Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM python:3.10-slim
2
 
3
  ENV PYTHONDONTWRITEBYTECODE=1
4
  ENV PYTHONUNBUFFERED=1
5
- ENV HF_HOME=/tmp/huggingface
6
  ENV NLTK_DATA=/app/nltk_data
7
  ENV PORT=8080
8
  ENV TRANSFORMERS_OFFLINE=0
@@ -16,11 +16,7 @@ RUN apt-get update && apt-get install -y \
16
  curl \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Create necessary directories with proper permissions
20
- RUN mkdir -p /app/nltk_data && \
21
- mkdir -p /tmp/huggingface && \
22
- chmod -R 777 /app && \
23
- chmod -R 777 /tmp/huggingface
24
 
25
  COPY requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt && \
@@ -35,4 +31,4 @@ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
35
  CMD curl -f http://localhost:8080/health || exit 1
36
 
37
  EXPOSE 8080
38
- CMD ["gunicorn", "app:app"]
 
2
 
3
  ENV PYTHONDONTWRITEBYTECODE=1
4
  ENV PYTHONUNBUFFERED=1
5
+ ENV HF_HOME=/app/hf_cache
6
  ENV NLTK_DATA=/app/nltk_data
7
  ENV PORT=8080
8
  ENV TRANSFORMERS_OFFLINE=0
 
16
  curl \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ RUN mkdir -p /app/nltk_data /app/hf_cache && chmod -R 777 /app
 
 
 
 
20
 
21
  COPY requirements.txt .
22
  RUN pip install --no-cache-dir -r requirements.txt && \
 
31
  CMD curl -f http://localhost:8080/health || exit 1
32
 
33
  EXPOSE 8080
34
+ CMD ["gunicorn", "app:app"]