aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docker/Dockerfile
blob: 0f2afdb9b1ce08392f05b9dcc42dbe58948c6c51 (plain) (blame)
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
FROM alpine:3.17 AS base

FROM base AS build

RUN apk add --no-cache gcc libffi-dev make musl-dev python3-dev py3-pip

COPY ["requirements.txt", "/tmp/"]
RUN pip3 install --no-cache-dir --target=/deps -r /tmp/requirements.txt

FROM base

LABEL maintainer="Egor Tensin <Egor.Tensin@gmail.com>"

RUN apk add --no-cache bash git openssh-client python3 tini

COPY --from=build ["/deps", "/deps/"]
ENV PYTHONPATH="/deps:/usr/src"

ARG ssh_sock_dir=/
ARG ssh_sock_path="$ssh_sock_dir/ssh-agent.sock"
ENV SSH_AUTH_SOCK "$ssh_sock_path"

COPY ["docker/entrypoint.sh", "/"]
COPY ["docker/get_output_dir.py", "/"]
COPY ["docker/schedule.sh", "/"]
COPY ["cgitize/", "/usr/src/cgitize/"]

ENV SCHEDULE_ON_START=1
ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]

WORKDIR /usr/src
CMD ["python3", "-m", "cgitize.main"]