forked from fossasia/open-event-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (30 loc) · 1.1 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
FROM python:3.8.6-alpine as base
####
FROM base as builder
RUN apk update && \
apk add --virtual build-deps make git g++ python3-dev musl-dev jpeg-dev zlib-dev libevent-dev file-dev libffi-dev openssl && \
apk add postgresql-dev libxml2-dev libxslt-dev
# PDF Generation: weasyprint (libffi-dev jpeg-dev already included above)
RUN apk add --virtual gdk-pixbuf-dev
ENV POETRY_HOME=/opt/poetry \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1
ENV PATH="$POETRY_HOME/bin:$PATH"
RUN set -eo pipefail; wget -O - https://install.python-poetry.org | python -
WORKDIR /opt/pysetup
COPY pyproject.toml ./
COPY poetry.lock ./
RUN poetry install --no-root --no-dev
####
FROM base
COPY --from=builder /opt/pysetup/.venv /opt/pysetup/.venv
ENV PATH="/opt/pysetup/.venv/bin:$PATH"
RUN apk --no-cache add postgresql-libs ca-certificates libxslt jpeg zlib file libxml2
# PDF Generation: weasyprint
RUN apk --no-cache add cairo-dev pango-dev ttf-opensans
RUN fc-cache -f
WORKDIR /data/app
ADD . .
RUN ["sh", "scripts/l10n.sh", "generate"]
EXPOSE 8080
ENTRYPOINT ["sh", "scripts/container_start.sh"]