Spaces:
Paused
Paused
Create Dockerfile
Browse files- 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"]
|