pip install fastapi
pip install uvicorn
- flyio install
- login flyio
fly auth login
- create fly.toml
flyctl launch
- update according to requirement
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}
RUN apt-get update && apt-get install -y \
python3-pip \
python3-venv \
python3-dev \
python3-setuptools \
python3-wheel
RUN mkdir -p /app
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
- requirements.txt is reference
flyctl deploy