Skip to content

Commit 6f895d5

Browse files
authored
Better user handling (#42)
1 parent 6da61c2 commit 6f895d5

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ services:
1717
context: ./docker/app
1818
args:
1919
- XDEBUG
20+
- CONTAINER_USER
2021
working_dir: /var/www/app
21-
environment:
22-
- CONTAINER_USER
2322

2423
app:
2524
extends: app_base

docker/app/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM php:7-fpm
22

3-
RUN apt-get -y -qq update && \
4-
apt-get -y -qq install --no-install-recommends gosu git unzip libpng-dev libjpeg-dev libfreetype6-dev libicu-dev libzip-dev libxml2-dev libxslt-dev libwebp-dev && \
3+
RUN apt-get -y update && \
4+
apt-get -y install --no-install-recommends git unzip libpng-dev libjpeg-dev libfreetype6-dev libicu-dev libzip-dev libxml2-dev libxslt-dev libwebp-dev && \
55
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ --with-webp=/usr && \
66
docker-php-ext-install -j$(nproc) pdo_mysql bcmath gd intl opcache zip soap xsl && \
77
pecl install apcu && \
@@ -17,13 +17,12 @@ RUN curl -Lo /usr/bin/composer https://getcomposer.org/composer-stable.phar && \
1717
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash && \
1818
apt-get install -y nodejs
1919

20-
RUN useradd -m app
20+
ARG CONTAINER_USER
21+
RUN useradd -m app -u $CONTAINER_USER
2122

2223
ARG XDEBUG
2324

2425
RUN if [ $XDEBUG ]; then pecl install xdebug && docker-php-ext-enable xdebug; fi
2526

26-
COPY ./docker-entrypoint.sh /
27-
ENTRYPOINT ["/docker-entrypoint.sh"]
28-
27+
USER app
2928
CMD ["php-fpm", "-F", "-R"]

docker/app/docker-entrypoint.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)