This guide will walk you through the steps to Dockerize and run your Python Flask application.
- Docker installed on your machine
- Your application code
To build the Docker image, navigate to the directory containing your Dockerfile and run the following command:
docker build --tag cube-solve-api .This command builds a Docker image using the Dockerfile in the current directory and tags it as Cube-solve-API.
After the image has been built, you can run it as a container with the following command:
docker run -p 5000:5000 cube-solve-apiThis command runs the Docker container and maps port 5000 inside the container to port 5000 on your host machine.
Once the Docker container is running, you can access your application at http://localhost:5000.