zkt25/dockerfile
2025-03-19 17:03:51 +01:00

22 lines
494 B
Plaintext

# Use an official Python runtime as a parent image
FROM python:3.8-slim
# Set the working directory inside the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install Flask
RUN pip install --no-cache-dir flask
# Set the environment variable for Flask
ENV FLASK_APP=testapp.py
ENV FLASK_RUN_HOST=0.0.0.0
# Expose port 5000 for the Flask app
EXPOSE 5000
# Run the Flask application
CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]