2022-12-13 00:11:56 +00:00
|
|
|
FROM docker.io/debian:bullseye-slim AS builder
|
|
|
|
|
|
|
|
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
|
|
ca-certificates git curl python3 python3-pip python3-venv
|
|
|
|
|
|
|
|
ENV PATH=/venv/bin:/root/.local/bin:$PATH
|
|
|
|
RUN python3 -m venv /venv && python3 -m pip install wheel
|
|
|
|
RUN curl -fL https://install.python-poetry.org | python3 -
|
|
|
|
|
2023-04-23 11:02:32 +00:00
|
|
|
ARG VERSION=d46bc86dccd3c8d956050a15f6e3e3dddf718caa
|
2023-03-26 17:25:08 +00:00
|
|
|
RUN git clone https://git.sr.ht/~nicoco/slidge /slidge && \
|
|
|
|
cd /slidge && git reset --hard ${VERSION}
|
|
|
|
|
|
|
|
ARG PLUGINS="skype discord whatsapp"
|
2023-03-05 18:40:48 +00:00
|
|
|
RUN cd /slidge && poetry export --extras="$PLUGINS" --without-hashes > requirements.txt && \
|
2022-12-13 00:11:56 +00:00
|
|
|
python3 -m pip install --requirement requirements.txt
|
|
|
|
|
|
|
|
RUN cp -R /slidge/slidge /venv/lib/python3.9/site-packages/slidge
|
|
|
|
|
2023-03-26 17:25:08 +00:00
|
|
|
FROM docker.io/golang:1.20-bullseye AS builder-whatsapp
|
2022-12-13 00:11:56 +00:00
|
|
|
|
|
|
|
ENV GOBIN=/usr/bin
|
|
|
|
RUN go install github.com/go-python/gopy@latest && \
|
|
|
|
go install golang.org/x/tools/cmd/goimports@latest
|
|
|
|
|
|
|
|
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
|
|
ca-certificates python3 python3-dev python3-pip
|
|
|
|
|
|
|
|
RUN python3 -m pip install pybindgen
|
|
|
|
|
|
|
|
COPY --from=builder /slidge /
|
|
|
|
RUN cd /slidge/plugins/whatsapp && gopy build -vm=python3 -output=generated -no-make=true .
|
|
|
|
|
|
|
|
FROM docker.io/debian:bullseye-slim
|
2022-12-31 12:24:57 +00:00
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
ENV PATH=/venv/bin:$PATH
|
2022-12-13 00:11:56 +00:00
|
|
|
|
|
|
|
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
2023-04-03 12:49:31 +00:00
|
|
|
ca-certificates python3 libpython3.9 python3-gdbm libidn11 libmagic1 media-types shared-mime-info
|
2022-12-13 00:11:56 +00:00
|
|
|
|
2022-12-31 12:24:57 +00:00
|
|
|
RUN addgroup --system --gid 10000 slidge
|
|
|
|
RUN adduser --system --uid 10000 --ingroup slidge --home /var/lib/slidge slidge
|
2022-12-13 00:11:56 +00:00
|
|
|
|
|
|
|
COPY --from=builder /venv /venv
|
|
|
|
COPY --from=builder-whatsapp /slidge/plugins/whatsapp/generated /venv/lib/python3.9/site-packages/slidge/plugins/whatsapp/generated
|
|
|
|
|
2022-12-31 12:24:57 +00:00
|
|
|
USER slidge
|
2022-12-13 00:11:56 +00:00
|
|
|
ENTRYPOINT ["python", "-m", "slidge"]
|