Skip to main content

DeployPRO - Flask Sample

This free sample can be used to test the deployment for a simple Flask project.

👉 DeployPRO Flask Sample - source code


How to use it

This Flask sample is provided with Docker support, the only input expected by DeployPRO service.

FROM python:3.9-slim-buster
WORKDIR /app
COPY ./requirements.txt /app
RUN pip install -r requirements.txt
COPY . .
ENV FLASK_APP=app.py

EXPOSE 5000
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "app:app"]

The above Dockerfile does the following:

  • Pull the Image for Python, version 3.9
  • Install the dependencies
  • Update the ENVIRONMENT
  • Expose the port 5000
  • Starts the project via Gunicorn WSGI Server

This setup can be tested in a local workstation by cloning the sources from GitHub and type:

$ docker-compose up --build

In order to have a succesfull deployment, DeployPRO needs to know:

  • the path to the Dockerfile
    • for this sample is ./Dockerfile
  • the external port
    • for this sample is 5000 (EXPOSE directive)

Once the above input is provided by the user, DeployPRO should operate the deployment without issues.


✅ Resources

  • 👉 Deploy Projects using your preferred provider: AWS, DigitalOcean, Azure, and GCP (soon)
  • 👉 Get Deployment Support from the team behind this service
  • 👉 Join the Community and chat with the team behind DeployPRO