-
Notifications
You must be signed in to change notification settings - Fork 3
/
DockerfileProd
39 lines (26 loc) · 1.22 KB
/
DockerfileProd
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
## This one is based on Debian
FROM quay.io/avarabyeu/golang-base as go-build
ENV WORKDIR=/go/src/github.com/avarabyeu/rpquiz/
WORKDIR $WORKDIR
#COPY glide.lock glide.yaml Makefile ./
COPY Gopkg.toml Gopkg.lock Makefile ./
RUN dep ensure --vendor-only
ADD ./bot/ ./bot/
RUN make build
FROM quay.io/avarabyeu/rpbot-base
ADD nlp/requirements.txt /requirements.txt
RUN python -m venv /venv \
&& /venv/bin/pip install -U pip \
&& LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "/venv/bin/pip install --no-cache-dir -r /requirements.txt"
ENV VOCAB_DIR=${WORKDIR}/nlp/vocab/en-us
ENV QUESTION_FILE=/usr/bin/rpQuestions.json
# uWSGI configuration (customize as needed):
ENV FLASK_APP=/nlp/wsgi.py UWSGI_WSGI_FILE=/nlp/wsgi.py UWSGI_SOCKET=:3031 UWSGI_HTTP=:5000 UWSGI_VIRTUALENV=/venv UWSGI_MASTER=1 UWSGI_WORKERS=2 UWSGI_THREADS=8 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy PYTHONDONTWRITEBYTECODE=1
ENV PATH="/venv/bin:${PATH}"
ENV PYTHONPATH="/nlp"
ADD nlp/ /nlp/
COPY --from=go-build /go/src/github.com/avarabyeu/rpquiz/bin/rpquiz /usr/bin/rpquiz
COPY rpQuestions.json /usr/bin/
## Building python stuff
ADD supervisor.ini /etc/supervisor.ini
ENTRYPOINT ["/usr/bin/supervisord", "--nodaemon", "--configuration", "/etc/supervisor.ini"]