mike23415 commited on
Commit
2eb47b3
·
verified ·
1 Parent(s): 722a1ec

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -8
Dockerfile CHANGED
@@ -1,9 +1,7 @@
1
  FROM python:3.9-slim
2
 
3
- # Set working direct
4
  WORKDIR /app
5
 
6
- # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  build-essential \
9
  git \
@@ -12,24 +10,22 @@ RUN apt-get update && apt-get install -y \
12
  libgl1-mesa-glx \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Create writable cache directories
16
  RUN mkdir -p /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
17
  chmod -R 777 /tmp
18
 
19
- # Copy and install Python dependencies
20
  COPY requirements.txt .
21
  RUN python -m pip install --upgrade pip && \
22
  python -m pip install --no-cache-dir -r requirements.txt -v
23
 
24
- # Copy app code
25
  COPY app.py .
26
 
27
- # Set required env variables
 
 
 
28
  ENV HF_HOME=/tmp/hf_home
29
  ENV XDG_CACHE_HOME=/tmp/cache
30
 
31
- # Expose the Flask port
32
  EXPOSE 7860
33
 
34
- # Run the Flask app
35
  CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  git \
 
10
  libgl1-mesa-glx \
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
13
  RUN mkdir -p /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
14
  chmod -R 777 /tmp
15
 
 
16
  COPY requirements.txt .
17
  RUN python -m pip install --upgrade pip && \
18
  python -m pip install --no-cache-dir -r requirements.txt -v
19
 
 
20
  COPY app.py .
21
 
22
+ # Set Hugging Face token as environment variable
23
+ # Replace <your_hf_token> with your actual token
24
+ ENV HF_TOKEN=<your_hf_token>
25
+
26
  ENV HF_HOME=/tmp/hf_home
27
  ENV XDG_CACHE_HOME=/tmp/cache
28
 
 
29
  EXPOSE 7860
30
 
 
31
  CMD ["python", "app.py"]