1 Star 0 Fork 0

lkgGitee/my_lit_nlp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
lkgGitee 提交于 2021-02-19 00:05 . init
# 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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/lkgGitee/my_lit_nlp.git
[email protected]:lkgGitee/my_lit_nlp.git
lkgGitee
my_lit_nlp
my_lit_nlp
master

搜索帮助