Execute script python using curl

Replace this template with your information

I create a dockerfile like this :slight_smile:FROM ubuntu:20.04
LABEL maintainer="raymondvicente@orange.fr"
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get install -y python3 python3-pip
RUN pip3 install Flask
ADD ./hello.py /home/hello.py
CMD [ “python3” , “/home/hello.py” ]

and the script it’s very simple :
from flask import Flask

app = Flask(name)

def index():
return “bonjour a tous!”

if name == “main”:

it’s in gitlab now. But i would like to test the script with curl. Is-it possible ? if yes could you help me. Thank you.

This may be a basic question, but how are you deploying your app to a server? Are you unable to perform a curl to the app once it is deployed on your service of choice?

For example, Heroku supports Python based apps (incl. use of Flask, Django, etc.): https://devcenter.heroku.com/articles/getting-started-with-python?singlepage=true

And GitLab supports deploying to Heroku using its CI/CD configs: https://docs.gitlab.com/ee/ci/examples/test-and-deploy-python-application-to-heroku.html

Hi thank you for your answer. I am trying to better explain what i need (sorry for my bad english). It’s an exercice. I have 2 pc
First PC i have i made a script i tested it and i was ok localy. i pushed it in the second one. Our teacher would want that this script must operationnel since outsiter using curl. It’s better for you ? I use python and gitlab since two weeks only. Thank you to help me