File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ SPIN_PHP_IMAGE=${SPIN_PHP_IMAGE:-"serversideup/php:beta-cli"}
15
15
SPIN_NODE_IMAGE=${SPIN_NODE_IMAGE:- " node:20" }
16
16
SPIN_ANSIBLE_IMAGE=${SPIN_ANSIBLE_IMAGE:- " willhallonline/ansible:2.15-alpine-3.18" }
17
17
18
+ # ## Default Users
19
+ SPIN_DEFAULT_PHP_USER=${SPIN_DEFAULT_RUN_USER_PHP:- " www-data" }
20
+ SPIN_DEFAULT_PHP_SERVICE_NAME=${SPIN_DEFAULT_PHP_RUN_SERVICE:- " php" }
21
+
18
22
# Import common functions
19
23
source " $SPIN_HOME /lib/functions.sh"
20
24
@@ -118,6 +122,10 @@ main() {
118
122
source " $SPIN_HOME /lib/actions/new.sh"
119
123
action_new " $@ "
120
124
;;
125
+ php)
126
+ source " $SPIN_HOME /lib/actions/php.sh"
127
+ action_php " $@ "
128
+ ;;
121
129
provision)
122
130
source " $SPIN_HOME /lib/actions/provision.sh"
123
131
action_provision " $@ "
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 -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_USER_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
1
+ #! /usr/bin/env bash
2
+ action_php (){
3
+ docker_pull_check " $@ "
4
+
5
+ local args=($( filter_out_spin_arguments " $@ " ) )
6
+
7
+ # Run Docker Compose without dependencies. Ensure automations and S6 logging are disabled
8
+ $COMPOSE_CMD run --remove-orphans --no-deps --rm \
9
+ --entrypoint ' ' \
10
+ -e " LOG_LEVEL=off" \
11
+ --user $SPIN_DEFAULT_PHP_USER \
12
+ $SPIN_DEFAULT_PHP_SERVICE_NAME \
13
+ " ${args[@]} "
14
+ }
You can’t perform that action at this time.
0 commit comments