blob: 07720f239e6ae96730504f5bfc746e3e2f65475b (
plain)
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
|
FROM python:3.9-alpine AS base
LABEL MAINTAINER="heckyel@riseup.net"
FROM base AS builder
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN apk add --no-cache musl-dev build-base make gcc g++ libffi-dev
ARG APP_DIR="/srv/app"
RUN mkdir --parents "$APP_DIR"
WORKDIR "$APP_DIR"
COPY database /srv/app/database
COPY routes /srv/app/routes
COPY utils /srv/app/utils
COPY config.py /srv/app
COPY main.py /srv/app
COPY wsgi.py /srv/app
COPY requirements.txt /srv/app
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir --prefix=/install wheel gunicorn
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
FROM base
WORKDIR /srv/app
COPY --from=builder /install /usr/local
COPY --from=builder /srv/app /srv/app
EXPOSE 5000
COPY entrypoint.sh /
RUN chmod u+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
|