File tree 4 files changed +8
-5
lines changed
4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ action_new(){
8
8
shift 1
9
9
latest_image=$SPIN_PHP_IMAGE
10
10
docker pull $latest_image
11
- docker run --rm -w /var/www/html -v $( pwd) :/var/www/html --user ${SPIN_USER_ID} -e " LOG_LEVEL=off" $latest_image composer create-project laravel/laravel " $@ "
11
+ docker run --rm -w /var/www/html -v $( pwd) :/var/www/html --user " $SPIN_DEFAULT_PHP_USER : $SPIN_GROUP_ID " -e " LOG_LEVEL=off" $latest_image composer create-project laravel/laravel " $@ "
12
12
install_spin_package_to_project php " ${@:- laravel} " --force
13
13
source " $SPIN_HOME /lib/actions/init.sh"
14
14
action_init --template=laravel --project-directory=" ${@:- laravel} " --force
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ action_php(){
8
8
$COMPOSE_CMD run --remove-orphans --no-deps --rm \
9
9
--entrypoint ' ' \
10
10
-e " LOG_LEVEL=off" \
11
- --user $SPIN_DEFAULT_PHP_USER \
11
+ --user " $SPIN_DEFAULT_PHP_USER : $SPIN_GROUP_ID " \
12
12
$SPIN_DEFAULT_PHP_SERVICE_NAME \
13
13
" ${args[@]} "
14
14
}
Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ FROM serversideup/php:beta-8.3-fpm-nginx as base
6
6
FROM base as development
7
7
8
8
# Fix permission issues in development
9
- # by setting the "www-data" user to the same UID as
10
- # the developer's user.
9
+ # by setting the "www-data" user to the
10
+ # same user and group that is running docker .
11
11
ARG USER_ID
12
- RUN usermod -u $USER_ID www-data
12
+ ARG GROUP_ID
13
+ RUN usermod -u $USER_ID www-data && \
14
+ groupmod -g $GROUP_ID www-data
13
15
14
16
FROM base as deploy
15
17
COPY --chown=www-data:www-data . /var/www/html
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ services:
20
20
target : development
21
21
args :
22
22
USER_ID : ${SPIN_USER_ID}
23
+ GROUP_ID : ${SPIN_GROUP_ID}
23
24
volumes :
24
25
- .:/var/www/html/
25
26
networks :
You can’t perform that action at this time.
0 commit comments