我正在尝试为高山映像运行docker,但无法从requirements.txt安装psycopg2,尝试了所有解决类似问题的解决方案,但均无效果。
Dockerfile
FROM frolvlad/alpine-miniconda3:python3.7 as base
FROM base as builder
# RUN apt-get update \
# && apt-get install -y build-essential \
# && apt-get install -y nginx
WORKDIR /usr/src/app
COPY ./requirements.txt /usr/src/app/requirements.txt
RUN python -m venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install gunicorn
RUN pip install -r requirements.txt
FROM base
RUN apk add nginx bash
# RUN conda install python==3.7.1
COPY --from=builder /usr/src/app /usr/src/app
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY . /usr/src/app/rapid-nrn-backend
WORKDIR /usr/src/app/rapid-nrn-backend
CMD ["/bin/bash", "entrypoint.sh"]
EXPOSE 80
EXPOSE 8000
requirements.txt requirements.txt
我们非常感谢您的帮助。