version: '3.8' services: fastapi_api: build: context: ./<path to Dockerfile> # the 'app.main' part of the next line assumes your main.py file is in a folder named 'app' command: gunicorn app.main:app --bind 0.0.0.0:5000 -w 2 -k uvicorn.workers.UvicornWorker ports: # host:container - "8000:5000"
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter