Niansuh commited on
Commit
1d5d7cc
1 Parent(s): 1d6bb70

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
9
+
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Set environment variables (MySQL credentials)
14
+ ENV MYSQL_HOST=${MYSQL_HOST}
15
+ ENV MYSQL_USER=${MYSQL_USER}
16
+ ENV MYSQL_PASSWORD=${MYSQL_PASSWORD}
17
+ ENV MYSQL_DB=${MYSQL_DB}
18
+
19
+ # Expose the port the app runs on
20
+ EXPOSE 5000
21
+
22
+ # Run the Flask app
23
+ CMD ["python", "app.py"]