代码拉取完成,页面将自动刷新
# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.7-slim
# Default demo app command to run.
ENV APP_COMMAND "lit_nlp.examples.pretrained_lm_demo:get_wsgi_app()"
# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
# Update Ubuntu packages and install basic utils
RUN apt-get update
RUN apt-get install -y wget curl gnupg2 gcc g++
# Install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update && apt -y install yarn
# Install Anaconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/anaconda3 \
&& rm Miniconda3-latest-Linux-x86_64.sh
# Set path to conda
ENV PATH /opt/anaconda3/bin:$PATH
# Set up conda environment with production dependencies
# This step is slow as it installs many packages.
COPY environment.yml .
RUN conda env create -f environment.yml
# Workaround for 'conda activate' depending on shell features
# that don't necessarily work in Docker.
# This simulates the effect of 'conda activate'
# See https://github.com/ContinuumIO/docker-images/issues/89
# If this breaks in a future version of conda, add
# RUN conda shell.posix activate lit-nlp
# to see what conda activate lit-nlp would do, and update the commands below
# accordingly.
ENV PATH /opt/anaconda3/envs/lit-nlp/bin:$PATH
ENV CONDA_PREFIX "/opt/anaconda3/envs/lit-nlp"
ENV CONDA_SHLVL "1"
ENV CONDA_DEFAULT_ENV "lit-nlp"
# Build front-end with yarn
WORKDIR lit_nlp/client
RUN yarn && yarn build && rm -rf node_modules/*
WORKDIR $APP_HOME
# Run LIT server
CMD exec gunicorn -c lit_nlp/examples/gunicorn_config.py $APP_COMMAND
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。