Znfeoqm commited on
Commit
58786c1
·
verified ·
1 Parent(s): e0ce5a2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -18
Dockerfile CHANGED
@@ -1,24 +1,19 @@
1
- # Use a slim version of the Nginx image as the base
2
- FROM alpine:3.18
3
 
4
- # Install Nginx and its dependencies
5
- RUN apk add --no-cache nginx
6
 
7
- # Create and set permissions for Nginx run and cache directories
8
- RUN mkdir -p /var/cache/nginx /var/run/nginx /var/log/nginx && \
9
- chown -R nginx:nginx /var/cache/nginx /var/run/nginx /var/log/nginx
10
 
11
- # Copy the custom Nginx configuration to the main Nginx config file location
12
- COPY nginx.conf /etc/nginx/nginx.conf
 
13
 
14
- # Copy the local index.html file into the container's web root directory
15
- COPY index.html /usr/share/nginx/html/index.html
16
-
17
- # Change ownership of the web root directory
18
- RUN chown -R nginx:nginx /usr/share/nginx/html
19
-
20
- # Expose port 7860, as required by Hugging Face Spaces
21
  EXPOSE 7860
22
 
23
- # Command to run Nginx directly, bypassing the default entrypoint
24
- CMD ["nginx", "-g", "daemon off;"]
 
1
+ # Use a lightweight Python base image
2
+ FROM python:3.9-slim-buster
3
 
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
 
7
+ # Copy the requirements file and install dependencies
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy the Flask application and your HTML file
12
+ COPY app.py .
13
+ COPY index.html .
14
 
15
+ # Expose the port Flask will run on
 
 
 
 
 
 
16
  EXPOSE 7860
17
 
18
+ # Command to run the Flask application
19
+ CMD ["python", "app.py"]