-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
31 lines (24 loc) · 900 Bytes
/
Dockerfile
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
FROM python:3.11.6-slim-buster
ARG UNAME=apps
ARG UID=1000
ARG GID=1000
ENV POETRY_HOME=/opt/poetry
ENV WORKDIR=/home/$UNAME/code
ENV PATH=$PATH:/home/$UNAME/.local/bin/
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -fr /var/lib/apt/lists/*
RUN python -m pip install --upgrade --no-cache-dir pip==23.3.1
# Install Poetry
RUN curl -sSl https://install.python-poetry.org | python - --version 1.7.1 \
&& ln -s ${POETRY_HOME}/bin/poetry /usr/local/bin/poetry
RUN groupadd -g $GID $UNAME \
&& useradd -m -u $UID -g $GID -s /bin/bash $UNAME \
&& mkdir -p $WORKDIR \
&& chown $UNAME:$UNAME $WORKDIR
USER $UNAME
WORKDIR $WORKDIR
COPY --chown=apps ./ $WORKDIR
RUN poetry install --no-ansi --no-interaction --no-root
CMD ["poetry", "run", "python", "-m", "pytest","--color=no", \
"--cov-report=term-missing", "--cov=rtbhouse_sdk", "tests/"]