This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
61 lines (45 loc) · 1.67 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM python:3.8.2-slim-buster as base
FROM base as builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc g++ wget gnupg2 curl git
# chromedriver dependencies
RUN apt-get install -y libglib2.0 \
libnss3 \
libgconf-2-4 \
libfontconfig1
# install google chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb; exit 0
RUN apt-get -fy install
# install chromedriver
RUN apt-get install -yqq unzip
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
# install kubectl
RUN \
curl --silent --location --remote-name https://storage.googleapis.com/kubernetes-release/release/v1.16.10/bin/linux/amd64/kubectl \
&& chmod +x kubectl \
&& mv kubectl /usr/local/bin/kubectl
# set display port to avoid crash
ENV DISPLAY=:99
# permit installing private packages
ARG GEMFURY_TOKEN
ENV PIP_EXTRA_INDEX_URL https://pypi.fury.io/${GEMFURY_TOKEN}/dialogue/
# install poetry
ARG POETRY_VERSION="1.0.9"
RUN \
pip install --upgrade pip && \
pip install "poetry==${POETRY_VERSION}" && \
poetry config virtualenvs.create false
# standard python project
COPY pyproject.toml poetry.lock ./
RUN poetry install -vvv --no-dev
FROM base as final
ENV PORT 80
EXPOSE 80
WORKDIR /app
COPY --from=builder /usr/local /usr/local
RUN python -m spacy download en_core_web_md && \
python -m spacy link en_core_web_md en
COPY . .
ENTRYPOINT exec hypercorn covidfaq.main:app --graceful-timeout 30 --bind 0.0.0.0:${PORT}