-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.5 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1.5 KB
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
41
42
43
44
45
46
47
48
49
50
FROM python:3.13-slim
ENV PYTHONUNBUFFERED=1
ENV DB_HOST=mysql
ENV DB_PASSWORD=Pa55w0rd
ENV POETRY_VERSION=2.1.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
RUN apt update \
&& apt install -y --no-install-recommends default-mysql-client libmariadb-dev libpq-dev \
&& apt install -y --no-install-recommends libcurl4-openssl-dev \
&& apt install -y --no-install-recommends build-essential \
&& apt install -y --no-install-recommends xmlsec1 \
&& apt install -y --no-install-recommends libxrender1 \
&& apt install -y --no-install-recommends libxext6 \
&& apt install -y --no-install-recommends libmagic1 \
&& apt install -y --no-install-recommends libssl-dev \
&& apt install -y --no-install-recommends wget \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r docker && useradd -r -m -g docker docker
WORKDIR /app/integrations
# Install poetry separated from system interpreter
RUN mkdir -p /home/docker/.cache/pypoetry
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
COPY . /app/integrations
RUN poetry install
RUN chown -R docker:docker /home/docker
VOLUME /home/docker
RUN apt-get -y autoremove --purge && apt-get autoclean -y
RUN chown -R docker /opt
ENV PYTHONPATH $PYTHONPATH:/app
EXPOSE 8000
USER docker
CMD ["/app/integrations/entrypoint.sh"]