-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 1.17 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
FROM continuumio/miniconda3
# NAURON_MODE is a build argument and an environment variable that determines whether the image contains a full API, a
# gateway API or a worker. Expected value is one of ["API", "GATEWAY", "WORKER"].
ARG NAURON_MODE="API"
ENV NAURON_MODE=$NAURON_MODE
# Configuring Conda environment
COPY environments/* ./
RUN if [ "$NAURON_MODE" = "GATEWAY" ]; then \
conda env create -f environment.gateway.yml -n nauron; \
elif [ "$NAURON_MODE" = "WORKER" ]; then \
conda env create -f environment.worker.yml -n nauron; \
else \
conda env create -f environment.api.yml -n nauron; \
fi; \
rm environment*
WORKDIR /var/log/nauron
WORKDIR /estnltk-coreference-v1-tagger
VOLUME /estnltk-coreference-v1-tagger/coreference
VOLUME /estnltk-coreference-v1-tagger/stanza_resources
# Creating a mode-dependent entrypoint script
RUN if [ "$NAURON_MODE" = "WORKER" ]; then \
echo "coreference_tagger_worker.py" > run.sh; \
else \
echo "gunicorn --config config/gunicorn.ini.py --log-config config/logging.ini app:app" > run.sh; \
fi
COPY . .
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "nauron", "bash", "run.sh"]