kouki321 commited on
Commit
ae70948
·
verified ·
1 Parent(s): 50e03b7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -10
Dockerfile CHANGED
@@ -1,21 +1,33 @@
1
- FROM python:3.10-slim
 
2
 
3
- # Set environment variables for Transformers cache
4
- ENV TRANSFORMERS_CACHE=/app/cache
5
- ENV HF_HOME=/app/cache
6
 
7
- # Set working directory
 
 
 
 
 
 
 
8
  WORKDIR /app
9
 
10
- # Install Python dependencies
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
13
 
14
- # Copy application code and model
15
  COPY . .
16
 
17
- # Expose Streamlit or FastAPI port (change if you're not using 7860)
18
  EXPOSE 7860
19
 
20
- # Run your app
21
- CMD ["python", "app.py"]
 
1
+ # Use a Python base image
2
+ FROM python:3.9-slim
3
 
4
+ # Set environment variables to prevent bytecode generation and buffer output for logging
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
 
8
+ # Install system dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ gcc \
11
+ libgl1-mesa-glx \
12
+ libglib2.0-0 \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Set the working directory in the container
16
  WORKDIR /app
17
 
18
+ # Copy requirements.txt and install Python dependencies
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
+ RUN pip install accelerate
22
+
23
+ COPY model /app/model
24
+
25
 
26
+ # Copy the application code into the container
27
  COPY . .
28
 
29
+ # Expose the port your application will run on
30
  EXPOSE 7860
31
 
32
+ # Define the command to run your FastAPI application
33
+ CMD ["python", "app.py"]