-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
Copy pathDockerfile_pretrained_embeddings_spacy_de
87 lines (66 loc) · 2 KB
/
Dockerfile_pretrained_embeddings_spacy_de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Create common base stage
FROM python:3.6-slim as base
WORKDIR /build
# Create virtualenv to isolate builds
RUN python -m venv /build
# Install common libraries
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
# required by psycopg2 at build and runtime
libpq-dev \
# required for health check
curl \
&& apt-get autoremove -y
# Make sure we use the virtualenv
ENV PATH="/build/bin:$PATH"
# Stage to build and install everything
FROM base as builder
WORKDIR /src
# Install all required build libraries
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
build-essential \
wget \
openssh-client \
graphviz-dev \
pkg-config \
git-core \
openssl \
libssl-dev \
libffi6 \
libffi-dev \
libpng-dev
# Make sure we have the latest pip version
RUN pip install -U pip
# Copy only what we really need
COPY README.md .
COPY setup.py .
COPY setup.cfg .
COPY MANIFEST.in .
COPY alt_requirements/ ./alt_requirements
COPY requirements.txt .
COPY LICENSE.txt .
# Install dependencies
RUN pip install --no-cache-dir -r alt_requirements/requirements_pretrained_embeddings_spacy.txt
# Install and link spacy model
RUN pip install https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.1.0/de_core_news_sm-2.1.0.tar.gz#egg=de_core_news_sm==2.1.0--no-cache-dir > /dev/null \
&& python -m spacy link de_core_news_sm de
# Install Rasa as package
COPY rasa ./rasa
RUN pip install .[sql,spacy]
# Runtime stage which uses the virtualenv which we built in the previous stage
FROM base AS runner
WORKDIR /app
# Copy over default pipeline config
COPY docker/configs/config_pretrained_embeddings_spacy_de.yml config.yml
# Copy virtualenv from previous stage
COPY --from=builder /build /build
# Create a volume for temporary data
VOLUME /tmp
# Make sure the default group has the same permissions as the owner
RUN chgrp -R 0 . && chmod -R g=u .
# Don't run as root
USER 1001
EXPOSE 5005
ENTRYPOINT ["rasa"]
CMD ["--help"]