wolf1997 commited on
Commit
a5631c2
·
verified ·
1 Parent(s): 3daf1a8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -12
Dockerfile CHANGED
@@ -23,10 +23,6 @@ ENV HOME=/home/user \
23
  # Set the working directory
24
  WORKDIR $HOME/app
25
 
26
- # Create directories with proper permissions for app data
27
- RUN mkdir -p $HOME/app/logs $HOME/app/data $HOME/app/tmp && \
28
- chmod -R 755 $HOME/app
29
-
30
  # Copy pyproject.toml and uv.lock first to leverage Docker cache
31
  COPY --chown=user:user pyproject.toml uv.lock ./
32
 
@@ -36,12 +32,8 @@ RUN uv sync --frozen --no-dev
36
  # Copy the application code
37
  COPY --chown=user:user . $HOME/app
38
 
39
- # Ensure all app files have proper permissions
40
- RUN chmod -R 755 $HOME/app && \
41
- find $HOME/app -type f -name "*.py" -exec chmod 644 {} \;
42
-
43
- # Expose the port Streamlit runs on
44
- EXPOSE 8501
45
 
46
- # Command to run the application using uv
47
- CMD ["uv", "run", "streamlit", "run", "app.py"]
 
23
  # Set the working directory
24
  WORKDIR $HOME/app
25
 
 
 
 
 
26
  # Copy pyproject.toml and uv.lock first to leverage Docker cache
27
  COPY --chown=user:user pyproject.toml uv.lock ./
28
 
 
32
  # Copy the application code
33
  COPY --chown=user:user . $HOME/app
34
 
35
+ # Expose the port for Hugging Face Spaces (7860 is the default)
36
+ EXPOSE 7860
 
 
 
 
37
 
38
+ # Command to run the application with proper Streamlit configuration for HF Spaces
39
+ CMD ["uv", "run", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]