From the course: Hands-On OpenAI API: Building a Real-World Solution

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Building and publishing the Docker container image

Building and publishing the Docker container image - OpenAI API Tutorial

From the course: Hands-On OpenAI API: Building a Real-World Solution

Building and publishing the Docker container image

- [Instructor] In this video, we're going to build and publish the Docker image for the service. First, we need to create the requirements .txt file. This file contains a list of dependencies required for the project. So the dependencies are openAI and fastAPI, and finally, uvicorn. Then we need to create a docker file, which is a document that contains all the commands required to assemble an image using docker. Essentially, it's a recipe for creating docker images. So you can see that I'm using this base image and I'm configuring this folder as the working directory, and I am copying those three files. And then I am installing all the dependencies by using the requirements .TXT file, and then I'm exposing the port 8000. And finally I'm executing the service. Okay, so now let's create the image. I'm going to type, "docker" and then, "build." And then the tag is my username in docker hub and then kinderlogger, and finally v1. And I need to pass the context, which is the same folder…

Contents