我是云计算的新手,第一次在谷歌云平台上部署我的网络应用程序很困难。当我构建 docker 映像时,这意味着我运行了以下代码
docker build -t gcr.io/${PROJECT_ID}/insurance-streamlit:v1 .
进程被杀死,显示以下错误:
Killed
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 137
我猜我的应用程序可能太大了,因为权重文件已经超过 100MB。那么有没有办法解决呢?请告诉我详细信息,提前谢谢!
PS:我的 Dockerfile 如下:
FROM python:3.7
RUN pip install virtualenv
ENV VIRTUAL_ENV=/venv
RUN virtualenv venv -p python3
ENV PATH="VIRTUAL_ENV/bin:$PATH"
WORKDIR /app
ADD . /app
# Install dependencies
RUN pip install -r requirements.txt
# copying all files over
COPY . /app
# Expose port
ENV PORT 8501
# cmd to launch app when container is run
CMD streamlit run app.py
# streamlit-specific commands for config
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /root/.streamlit
RUN bash -c 'echo -e "\
[general]\n\
email = \"\"\n\
" > /root/.streamlit/credentials.toml'
RUN bash -c 'echo -e "\
[server]\n\
enableCORS = false\n\
" > /root/.streamlit/config.toml
我的 requirements.txt 就像:
albumentations==0.4.5
numpy==1.19.0
opencv-python==4.1.0.25
opencv-python-headless==4.2.0.34
pandas==1.0.5
Pillow==7.1.2
streamlit==0.62.0
torch==1.4.0
torchvision==0.5.0
matplotlib