-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
70 lines (57 loc) · 2 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
62
63
64
65
66
67
68
69
70
# base python image
FROM library/python:3.10.12-slim-bookworm
# set the working directory in the container
ENV WORKDIR /app
WORKDIR $WORKDIR
# install latest poppler - https://poppler.freedesktop.org/
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
wget \
cmake \
libboost-dev \
libmagickwand-dev \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
RUN wget -qO- 'https://poppler.freedesktop.org/poppler-23.07.0.tar.xz' | tar -xJ \
&& cd poppler-23.07.0 \
&& cmake . \
&& ldconfig \
&& make install \
&& cd $WORKDIR \
&& rm -rf poppler-23.07.0
# install latest pandoc - https://github.com/jgm/pandoc/releases
RUN wget -qO pandoc.deb 'https://github.com/jgm/pandoc/releases/download/3.2/pandoc-3.2-1-amd64.deb' \
&& dpkg -i pandoc.deb \
&& rm pandoc.deb
# app dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-opencv \
postgresql-client \
ffmpeg \
libzbar0 \
&& rm -rf /var/lib/apt/lists/*
# because https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/2204
RUN wget -qO libssl.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb \
&& dpkg -i libssl.deb \
&& rm libssl.deb
# copy poetry files
COPY ./pyproject.toml ./poetry.lock ./
# install python dependencies
RUN pip install --no-cache-dir -U poetry pip && poetry install --no-cache --only main --no-interaction
# install playwright
RUN poetry run playwright install-deps && poetry run playwright install chromium
# copy the code into the container
COPY . .
ENV FORWARDED_ALLOW_IPS='*'
ENV PYTHONUNBUFFERED=1
ARG CAPROVER_GIT_COMMIT_SHA=${CAPROVER_GIT_COMMIT_SHA}
ENV CAPROVER_GIT_COMMIT_SHA=${CAPROVER_GIT_COMMIT_SHA}
EXPOSE 8000
EXPOSE 8501
HEALTHCHECK CMD \
wget 127.0.0.1:8000 \
|| wget 127.0.0.1:8501 \
|| bash -c 'poetry run celery -A celeryapp inspect ping -d celery@$HOSTNAME' \
|| exit 1
ENTRYPOINT ["poetry", "run"]
CMD ["./scripts/run-prod.sh"]