ShutterStack commited on
Commit
847f2c7
·
verified ·
1 Parent(s): 3b6a82d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -7,25 +7,25 @@ WORKDIR /app
7
  # Copy the requirements.txt file first to leverage Docker's build cache.
8
  COPY requirements.txt .
9
 
10
- # Install Python dependencies (ensure gunicorn is listed in requirements.txt)
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Install Nginx
14
  RUN apt-get update && apt-get install -y nginx && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
- # Create a dedicated directory for Nginx's temporary files and set permissions.
18
- # Nginx typically runs as the 'www-data' user, which needs write access here.
19
  RUN mkdir -p /tmp/nginx_cache/client_body && \
 
20
  chown -R www-data:www-data /tmp/nginx_cache && \
21
  chmod -R 755 /tmp/nginx_cache
22
 
23
  # Copy the entire project directory into the container's /app directory.
24
- # This includes main.py, streamlit_app.py, routers/, utils/, data/, etc.
25
  COPY . .
26
 
27
  # Replace the default Nginx configuration with your custom one.
28
- # IMPORTANT: Your nginx.conf MUST be updated as shown in Step 2 to use the new temp path.
29
  COPY nginx.conf /etc/nginx/nginx.conf
30
 
31
  # Grant execution permissions to the start.sh script
 
7
  # Copy the requirements.txt file first to leverage Docker's build cache.
8
  COPY requirements.txt .
9
 
10
+ # Install Python dependencies (ensure gunicorn is listed here)
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Install Nginx and other necessary packages
14
  RUN apt-get update && apt-get install -y nginx && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
+ # Create and set permissions for all Nginx cache/temp directories needed.
18
+ # Nginx typically runs as the 'www-data' user, which needs write access.
19
  RUN mkdir -p /tmp/nginx_cache/client_body && \
20
+ mkdir -p /tmp/nginx_cache/proxy && \
21
  chown -R www-data:www-data /tmp/nginx_cache && \
22
  chmod -R 755 /tmp/nginx_cache
23
 
24
  # Copy the entire project directory into the container's /app directory.
 
25
  COPY . .
26
 
27
  # Replace the default Nginx configuration with your custom one.
28
+ # This nginx.conf MUST be updated as shown in Step 3 to use the new paths and logging.
29
  COPY nginx.conf /etc/nginx/nginx.conf
30
 
31
  # Grant execution permissions to the start.sh script