Fixes root polluting owner:group in host files
This commit is contained in:
committed by
tλeUniC
parent
83fa0493e2
commit
197ceb1fde
11
Dockerfile
11
Dockerfile
@@ -21,4 +21,13 @@ FROM prod AS local
|
||||
|
||||
RUN apt-get -y install git httpie \
|
||||
&& pecl install xdebug \
|
||||
&& docker-php-ext-enable xdebug
|
||||
&& docker-php-ext-enable xdebug
|
||||
|
||||
ARG UID
|
||||
ARG GID
|
||||
RUN usermod -u $UID www-data \
|
||||
&& groupmod -g $GID www-data \
|
||||
&& chown www-data:www-data /var/www
|
||||
|
||||
USER $UID:$GID
|
||||
WORKDIR /var/www/html
|
||||
|
||||
7
Makefile
7
Makefile
@@ -1,6 +1,9 @@
|
||||
# Run `make` (no arguments) to get a short description of what is available
|
||||
# within this `Makefile`.
|
||||
|
||||
# Our user and group id used as default container user:group id. Avoid permissions pollution
|
||||
UID := $(shell id -u)
|
||||
GID := $(shell id -g)
|
||||
export UID GID
|
||||
# Default shell to use
|
||||
SHELL := bash
|
||||
|
||||
@@ -92,4 +95,4 @@ deptrack: deps
|
||||
|
||||
.PHONY: shell
|
||||
shell:
|
||||
$(APP_SHELL) bash
|
||||
$(APP_SHELL) bash
|
||||
|
||||
@@ -14,9 +14,12 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
target: local
|
||||
args:
|
||||
- UID=${UID:-}
|
||||
- GID=${GID:-}
|
||||
init: true
|
||||
env_file: .env.docker.dist
|
||||
ports:
|
||||
- "8000:80"
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
- ./:/var/www/html
|
||||
|
||||
Reference in New Issue
Block a user