这是 Dockerfile:
FROM lambci/lambda:build-python3.6
# Copy in your requirements file
ADD requirements.txt /requirements.txt
# Copy your application code to the container
RUN mkdir /code/
WORKDIR /code/
ADD . /code/
ENV PS1 'zappa@$(pwd | sed "s@^/var/task/\?@@")\$ '
ADD zappa_settings.json /var/task/zappa_settings.json
WORKDIR /var/task
RUN virtualenv /var/venv && \
source /var/venv/bin/activate && \
pip install -U pip zappa && \
pip install -r /requirements.txt && \
deactivate
CMD ["zappa"]
但是,当我跑步时,docker-compose up
我得到:
Recreating basesite_web_1 ...
Recreating basesite_web_1 ... error
ERROR: for basesite_web_1 Cannot start service web: oci runtime error: container_linux.go:262: starting container process caused "exec: \"zappa\": executable file not found in $PATH"
ERROR: for web Cannot start service web: oci runtime error: container_linux.go:262: starting container process caused "exec: \"zappa\": executable file not found in $PATH"
ERROR: Encountered errors while bringing up the project.
我认为这是因为我需要激活 virtualenv。我希望能够在我的本地机器上运行该项目以进行开发。我错过了什么?谢谢!