About: Docker containerized version of Python example app from the OpenAI API quick start tutorial
Summary of changes:
Packaged the app in a Docker container so the guide could be easily deployed on any system (i.e., created Dockerfile)
Added Makefile to quickly and easily start up and close down (+ clean up) the app using make up and make down commands
Updated README instructions on how to run the Docker container using Make commands
Added app.run() function at the end of app.py script to run the server. I used if __name__=='__main__': to run the server only if the script is executed directly from the Python interpreter.
if __name__=='__main__':
app.run(debug=True)
Potential implications:
Gives others the option to run the app in a Docker container, but it doesn't change or take away the option to run on your local computer, just as you would now
Easier to run the app in different environments, without having to worry about compatibility issues or waste time debugging
Consistent and secure runtime environment, protecting the app from potential security vulnerabilities in the host system
About: Docker containerized version of Python example app from the OpenAI API quick start tutorial
Summary of changes:
make up
andmake down
commandsapp.run()
function at the end ofapp.py
script to run the server. I usedif __name__=='__main__':
to run the server only if the script is executed directly from the Python interpreter.Potential implications: