首页 > 解决方案 > "Python3 not found" error when deploying docker image to heroku

问题描述

So I'm trying to deploy my django powered web app to heroku using my docker file, But I keep getting a "python3 not found" error. Note that I've deployed this same application using zeit's now. My dockerfile looks like so:

FROM mhart/alpine-node

RUN echo "ipv6" >> /etc/modules
RUN echo "http://nl.alpinelinux.org/alpine/v3.7/community" >> /etc/apk/repositories

RUN apk add --no-cache python3 yarn && python3 -m ensurepip
RUN mkdir /code
WORKDIR /code
COPY .  /code
RUN pip3 install -r requirements.txt
RUN yarn
RUN yarn build:dev
EXPOSE $PORT
CMD [python3 manage.py runserver 0.0.0.0:$PORT ]

I've also attached a screenshot of my application's logs on heroku.

enter image description here

I tried adding the full path to the python3 package like so /usr/bin/python3 but it still failed. Any help would be appreciated

标签: pythondjangopython-3.xdockerheroku

解决方案


推荐阅读