I’m trying to deploy a Python service.
The dependency is managed by
When I run
LOG_LEVEL=debug flyctl launch, I see the following error.
Error app does not have a Dockerfile or buildpacks configured. See https://fly.io/docs/reference/configuration/#the-build-section
I can see several buildpack related repo for Python and Poetry, but I don’t know how to correctly configure it in
Maybe I should just write a Dockerfile.
Have no idea of Python but looking at the example repo and the docs page you linked to, do you have a
And just in case, is your entry
.py file in the root next to the
fly.toml? This is probably not needed with a
Procfile not sure tho.
Building a Dockerfile will serve you better over the longer term, as you’ll have more ability to control your build process & deviate from the (narrower) expectations and capabilities of a buildpack.
Here’s a “python and poetry dockerfile” example, we deploy this app to Fly. (Incidentally it also uses nodejs, but you should be able to strip out the parts you don’t need).
RUN mkdir /app
ENV PYTHONFAULTHANDLER=1 \
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y gdal-bin libgdal-dev && \
python -m pip install -U pip poetry
COPY poetry.lock pyproject.toml ./
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-root --no-dev && \
rm -rf ~/.cache/pypoetry && \
rm -rf ~/.config/pypoetry
COPY package.json yarn.lock /app/
RUN yarn install --frozen-lockfile --no-cache --production && yarn cache clean
COPY ./ /app/
RUN yarn build-prod && rm -rf node_modules/.cache
RUN ./manage.py collectstatic --noinput --ignore='*.map'
ENV PORT 8000
CMD /bin/sh -c 'waitress-serve \