Fix user/groupadd in container (#3826)

This commit is contained in:
jekkos
2024-02-02 12:36:29 +01:00
committed by jekkos
parent 84f3bd3bfb
commit a4b3469369
2 changed files with 8 additions and 3 deletions

View File

@@ -25,7 +25,12 @@ WORKDIR /app/tests
CMD ["/app/vendor/phpunit/phpunit/phpunit"]
FROM ospos AS ospos_dev
RUN addgroup -S $GID && adduser -S $UID -G $GID
ARG USERID
ARG GROUPID
RUN echo "Adding user uid $USERID with gid $GROUPID"
RUN ( addgroup --gid $GROUPID ospos || true ) && ( adduser --uid $USERID --gid $GROUPID ospos )
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \

View File

@@ -7,8 +7,8 @@ services:
build:
context: .
args:
- UID=${USERID}
- GID=${GROUPID}
- USERID=${USERID}
- GROUPID=${GROUPID}
target: ospos_dev
container_name: ospos_dev
restart: always