feliksius commited on
Commit
5404c0d
·
verified ·
1 Parent(s): a973a24

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -5
Dockerfile CHANGED
@@ -1,9 +1,12 @@
1
  # Use official Python 3.10 slim image for a smaller footprint
2
  FROM python:3.10-slim
3
 
4
- # Set environment variable for Hugging Face cache
5
- ENV TRANSFORMERS_CACHE=/app/cache
6
- ENV HF_HOME=/app/cache
 
 
 
7
 
8
  # Set working directory
9
  WORKDIR /app
@@ -20,7 +23,7 @@ RUN apt-get update && apt-get install -y \
20
  && pip install --no-cache-dir -r requirements.txt
21
 
22
  # Copy application code
23
- COPY app.py .
24
 
25
  # Create cache and logs directories with write permissions
26
  RUN mkdir -p /app/cache /app/logs \
@@ -30,4 +33,4 @@ RUN mkdir -p /app/cache /app/logs \
30
  EXPOSE 8000
31
 
32
  # Run Uvicorn server
33
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
  # Use official Python 3.10 slim image for a smaller footprint
2
  FROM python:3.10-slim
3
 
4
+ # Set environment variables
5
+ ENV TRANSFORMERS_CACHE=/app/cache \
6
+ HF_HOME=/app/cache \
7
+ USE_QUANTIZATION=0 \
8
+ DEVICE=-1 \
9
+ MAX_TEXT_LENGTH=5000
10
 
11
  # Set working directory
12
  WORKDIR /app
 
23
  && pip install --no-cache-dir -r requirements.txt
24
 
25
  # Copy application code
26
+ COPY app.py . # Sesuaikan jika namanya app.py
27
 
28
  # Create cache and logs directories with write permissions
29
  RUN mkdir -p /app/cache /app/logs \
 
33
  EXPOSE 8000
34
 
35
  # Run Uvicorn server
36
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]