Sign inSign up

hskent/fastapi-rts

By hskent

•Updated over 1 year ago

rts means ready to serve

Image
0

915

hskent/fastapi-rts repository overview

docker run -itd --name fastapi -p 5001:5001 hskent/fastapi-rts

working good with nginx proxy_pass

quick example:

server {
    listen 8080;

    location / {
        proxy_pass http://127.0.0.1:5001;
    }
}

with subnet

docker network create --subnet=172.19.0.0/16 fastapi-subnet

edit code /var/log/fastapi/main.py

docker run -itd -e TZ=Asia/Hong_Kong --name=fastapi --network fastapi-subnet --ip 172.19.0.10 -p 5001:5001 --privileged --restart=always -v /var/log/fastapi:/app/log hskent/fastapi-rts
server {
    listen 8080;
    server _;

    location / {
        proxy_pass http://172.19.0.10:5001$request_uri;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Tag summary

Content type

Image

Digest

sha256:0bdc8aead…

Size

61 MB

Last updated

over 1 year ago

docker pull hskent/fastapi-rts