kouki321 commited on
Commit
66c8686
·
verified ·
1 Parent(s): 93e7ae8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -1,28 +1,28 @@
1
  # Use a slim base image
2
  FROM python:3.10-slim
3
 
4
- # Install dependencies
5
  RUN apt-get update && \
6
  apt-get install -y git && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
- # Optional: copy requirements file and install
10
- COPY requirements.txt .
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy your app code into the container
14
  WORKDIR /app
15
  COPY app.py /app/app.py
16
 
17
  # Create a writable cache directory
18
  RUN mkdir -p /app/cache
19
 
20
- # Set environment variables for cache and disable root cache attempts
21
  ENV TRANSFORMERS_CACHE=/app/cache
22
  ENV HF_HOME=/app/cache
23
 
24
- # Expose port (for Gradio/Streamlit etc.)
25
  EXPOSE 7860
26
 
27
- # Launch your app
28
  CMD ["python", "app.py"]
 
1
  # Use a slim base image
2
  FROM python:3.10-slim
3
 
4
+ # Install system dependencies
5
  RUN apt-get update && \
6
  apt-get install -y git && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
+ # Copy and install Python dependencies
10
+ COPY requirements.txt /app/requirements.txt
11
+ RUN pip install --no-cache-dir -r /app/requirements.txt
12
 
13
+ # Create and set working directory
14
  WORKDIR /app
15
  COPY app.py /app/app.py
16
 
17
  # Create a writable cache directory
18
  RUN mkdir -p /app/cache
19
 
20
+ # Override default cache paths
21
  ENV TRANSFORMERS_CACHE=/app/cache
22
  ENV HF_HOME=/app/cache
23
 
24
+ # Expose port for your UI
25
  EXPOSE 7860
26
 
27
+ # Run the application
28
  CMD ["python", "app.py"]