codesuman / docker-fast-api

A simple Fast API project in Python & a Docker image creation process

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Commands

FastAPI Docker Blog

Docker Build

docker build tag <image_name> <docker_file_path>

docker build -t fast-api:v1.0.0 .

Docker Run

docker run daemon mode(Run container in background and print container ID) --name (container name) image_name

docker run -d --name fastapi -p 80:80 fast-api:v1.0.0

Execute commands in Docker Container

In order to execute commands on running containers, you have to execute “docker exec” and specify the container name (or ID) as well as the command to be executed on this container. Read more

docker exec -it fastapi sh

Docker Remove

Command to stop & remove running container

docker rm -f fastapi

About

A simple Fast API project in Python & a Docker image creation process


Languages

Language:Dockerfile 74.6%Language:Python 25.4%