Airmanv commited on
Commit
04a3407
·
verified ·
1 Parent(s): 241b1ff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -1,24 +1,22 @@
1
  FROM python:3.10
2
 
3
- # 1. Create a user with ID 1000 (required by Hugging Face)
4
  RUN useradd -m -u 1000 user
5
  USER user
 
 
6
  ENV HOME=/home/user \
7
- PATH=/home/user/.local/bin:$PATH
 
8
 
9
- # 2. Set the working directory
10
  WORKDIR $HOME/app
11
 
12
- # 3. CRITICAL FIX: Create the cache directory and give it full write permissions
13
- # This allows nfl_data_py to save the schedule data without crashing.
14
  RUN mkdir -p $HOME/.cache/nfl_data_py && chmod -R 777 $HOME/.cache
15
 
16
- # 4. Copy your files into the container
17
  COPY --chown=user . $HOME/app
18
 
19
- # 5. Install Python libraries
20
  RUN pip install --no-cache-dir --upgrade pip && \
21
  pip install --no-cache-dir -r requirements.txt
22
 
23
- # 6. Launch the App on port 7860
24
  CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0", "--server.port", "7860"]
 
1
  FROM python:3.10
2
 
3
+ # Create the user
4
  RUN useradd -m -u 1000 user
5
  USER user
6
+
7
+ # Set environment variables so nfl_data_py knows where to write
8
  ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:$PATH \
10
+ XDG_CACHE_HOME=/home/user/.cache
11
 
 
12
  WORKDIR $HOME/app
13
 
14
+ # Create the cache directory explicitly and give full permissions
 
15
  RUN mkdir -p $HOME/.cache/nfl_data_py && chmod -R 777 $HOME/.cache
16
 
 
17
  COPY --chown=user . $HOME/app
18
 
 
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
  pip install --no-cache-dir -r requirements.txt
21
 
 
22
  CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0", "--server.port", "7860"]