hamza82 commited on
Commit
af3b09e
·
verified ·
1 Parent(s): 3ff47af

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.8-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /usr/src/app
6
+
7
+ # Copy the current directory contents into the container at /usr/src/app
8
+ COPY . .
9
+
10
+ # Install any needed packages specified in requirements.txt
11
+ RUN pip install --no-cache-dir flask gunicorn
12
+
13
+ # Expose the ports the app runs on
14
+ EXPOSE 8080 8000
15
+
16
+ # Install Node.js for serving the static site and npm to install http-server
17
+ RUN apt-get update && \
18
+ apt-get install -y nodejs npm && \
19
+ npm install -g http-server
20
+
21
+ # Command to run the Flask app using Gunicorn on port 8000
22
+ CMD gunicorn -b :8000 app:app & http-server ./static -p 8080