coreos-home-server/service/slidge/Containerfile
Alex Palaistras 03d4fdcc05 slidge: Update to latest version
And fix Dockerfile for changes in build.
2023-03-05 18:48:09 +00:00

49 lines
1.7 KiB
Docker

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
ARG VERSION=841cb0856d54e7313f64b00080c7c84227631e55
RUN git clone https://git.sr.ht/~nicoco/slidge /slidge && \
cd /slidge && git reset --hard ${VERSION}
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 -
ARG PLUGINS="skype discord"
RUN cd /slidge && poetry export --extras="$PLUGINS" --without-hashes > requirements.txt && \
python3 -m pip install --requirement requirements.txt
RUN cp -R /slidge/slidge /venv/lib/python3.9/site-packages/slidge
FROM docker.io/golang:1.19-bullseye AS builder-whatsapp
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
ENV PYTHONUNBUFFERED=1
ENV PATH=/venv/bin:$PATH
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates python3 libpython3.9 python3-gdbm media-types
RUN addgroup --system --gid 10000 slidge
RUN adduser --system --uid 10000 --ingroup slidge --home /var/lib/slidge slidge
COPY --from=builder /venv /venv
COPY --from=builder-whatsapp /slidge/plugins/whatsapp/generated /venv/lib/python3.9/site-packages/slidge/plugins/whatsapp/generated
USER slidge
ENTRYPOINT ["python", "-m", "slidge"]