only create group if not exists

This commit is contained in:
burnettk 2024-07-01 15:10:18 -04:00
parent cb41f952d6
commit 6db4ab669f
No known key found for this signature in database
2 changed files with 11 additions and 11 deletions

View File

@ -8,14 +8,14 @@ ARG GROUP_NAME
WORKDIR /app
RUN apt-get update \
&& apt-get install -y -q git-core curl vim-tiny \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get install -y -q git-core curl vim-tiny \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN addgroup --gid $GROUP_ID $GROUP_NAME \
&& adduser --uid $USER_ID --gid $GROUP_ID $USER_NAME
RUN if ! getent group "$GROUP_ID"; then addgroup --gid $GROUP_ID $GROUP_NAME; fi
RUN adduser --uid $USER_ID --gid $GROUP_ID $USER_NAME
RUN git config --global --add safe.directory /app
RUN pip install --upgrade pip
RUN pip install poetry==1.8.1
RUN pip install poetry==1.8.1

View File

@ -3,11 +3,11 @@ FROM python:3.12.1-slim-bookworm
WORKDIR /app
RUN apt-get update \
&& apt-get install -y -q \
gcc libssl-dev libpq-dev default-libmysqlclient-dev \
pkg-config libffi-dev git-core curl sqlite3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get install -y -q \
gcc libssl-dev libpq-dev default-libmysqlclient-dev \
pkg-config libffi-dev git-core curl sqlite3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install poetry==1.8.1 pytest-xdist==3.5.0