Add Dockerfile
This commit is contained in:
parent
80c6fbd7bb
commit
be8d7d6eee
7 changed files with 71 additions and 34 deletions
40
Dockerfile
Normal file
40
Dockerfile
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
ARG PYTHON_VERSION=3.9
|
||||
FROM docker.io/python:${PYTHON_VERSION}-alpine as builder
|
||||
ARG LIBOLM_VERSION=3.2.10
|
||||
RUN apk add --no-cache \
|
||||
make \
|
||||
cmake \
|
||||
gcc \
|
||||
g++ \
|
||||
git \
|
||||
libffi-dev \
|
||||
yaml-dev \
|
||||
python3-dev
|
||||
|
||||
RUN set -ex; \
|
||||
git clone -b "${LIBOLM_VERSION}" https://gitlab.matrix.org/matrix-org/olm.git olm && cd olm; \
|
||||
cmake . -Bbuild ; \
|
||||
cmake --build build ; \
|
||||
make install ; \
|
||||
cd python && make olm-python3 ; \
|
||||
mkdir -p "/python-libs" || true ; \
|
||||
DESTDIR="/python-libs" make install-python3
|
||||
|
||||
RUN mkdir -p /app/ops_bot
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install --prefix="/python-libs" -r /app/requirements.txt
|
||||
|
||||
FROM docker.io/python:${PYTHON_VERSION}-alpine
|
||||
|
||||
COPY --from=builder /python-libs /usr/local
|
||||
COPY --from=builder /usr/local/lib/libolm* /usr/local/lib/
|
||||
|
||||
RUN apk add --no-cache \
|
||||
libstdc++ bash
|
||||
|
||||
RUN mkdir -p /app/ops_bot
|
||||
COPY ops_bot/ /app/ops_bot/
|
||||
ENV MATRIX_STORE_PATH=/data
|
||||
VOLUME ["/data"]
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["/usr/local/bin/python", "-m", "ops_bot.main"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue