0% found this document useful (0 votes)
2 views1 page

Dockerfile for Flask App with Gunicorn

This document is a Dockerfile that sets up a Python 3.9 environment for a Flask application. It installs required packages from a requirements.txt file, copies the application code into the container, and exposes port 5100. The application is configured to run using gunicorn with 4 worker processes.

Uploaded by

jamalarain1200
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Dockerfile for Flask App with Gunicorn

This document is a Dockerfile that sets up a Python 3.9 environment for a Flask application. It installs required packages from a requirements.txt file, copies the application code into the container, and exposes port 5100. The application is configured to run using gunicorn with 4 worker processes.

Uploaded by

jamalarain1200
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# Use an official Python runtime as a parent image

FROM python:3.9-slim

# Set the working directory inside the container


WORKDIR /app

# Copy the [Link] file to the container


COPY [Link] .

# Install the required packages


RUN pip install --no-cache-dir -r [Link]

# Copy the current directory contents into the container at /app


COPY . .

# Expose the port that the Flask app runs on


EXPOSE 5100

# Command to run the Flask application using gunicorn for production


CMD ["gunicorn", "--bind", "[Link]:5100", "app:app", "--workers=4"]

You might also like