forked from allenai/allennlp-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 loc) · 1.04 KB
/
Dockerfile
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
# This Dockerfile is used to serve the AllenNLP demo.
FROM allennlp/commit:adeb1b1278619ff2d74d4fd82825e50a36f95ff4
LABEL maintainer="allennlp-contact@allenai.org"
WORKDIR /stage/allennlp
# Install npm early so layer is cached when mucking with the demo
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y nodejs
# Install python dependencies
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
# Download spacy model
RUN spacy download en_core_web_sm
COPY scripts/ scripts/
COPY server/models.py server/models.py
# Now install and build the demo
COPY demo/ demo/
RUN ./scripts/build_demo.py
COPY tests/ tests/
COPY app.py app.py
COPY server/ server/
RUN pytest tests/
# Copy the configuration files used at runtime
COPY models.json models.json
COPY models_small.json models_small.json
# Optional argument to set an environment variable with the Git SHA
ARG SOURCE_COMMIT
ENV ALLENNLP_DEMO_SOURCE_COMMIT $SOURCE_COMMIT
EXPOSE 8000
ENTRYPOINT ["./app.py"]
CMD ["--demo-dir", "/stage/allennlp/demo"]