Skip to content

Commit

Permalink
creating user vessel and changing their UID via ENTRYPOINT to help pe…
Browse files Browse the repository at this point in the history
…rmissions/HOME directory issues when running tinker and other commands
  • Loading branch information
fideloper committed Nov 9, 2017
1 parent c2f9ac0 commit d1c71e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions docker-files/docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM ubuntu:16.04

LABEL maintainer="Chris Fidao"

RUN useradd -ms /bin/bash -u 1337 vessel
WORKDIR /var/www/html

ENV GOSU_VERSION 1.7
Expand Down
3 changes: 3 additions & 0 deletions docker-files/docker/app/start-container
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ sed -i "s/xdebug\.remote_host\=.*/xdebug\.remote_host\=$XDEBUG_HOST/g" /etc/php/
# Run PHP-FPM as current user
if [ ! -z "$WWWUSER" ]; then
sed -i "s/user\ \=.*/user\ \= $WWWUSER/g" /etc/php/7.1/fpm/pool.d/www.conf

# Set UID of user "vessel"
usermod -u $WWWUSER vessel
fi

# Ensure /.composer exists and is writable
Expand Down
6 changes: 3 additions & 3 deletions docker-files/vessel
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if [ $# -gt 0 ]; then
shift 1
if [ "$EXEC" == "yes" ]; then
$COMPOSE exec \
-u $WWWUSER \
-u vessel \
app \
php artisan "$@"
else
Expand All @@ -131,7 +131,7 @@ if [ $# -gt 0 ]; then
shift 1
if [ "$EXEC" == "yes" ]; then
$COMPOSE exec \
-u $WWWUSER \
-u vessel \
app \
composer "$@"
else
Expand All @@ -146,7 +146,7 @@ if [ $# -gt 0 ]; then
shift 1
if [ "$EXEC" == "yes" ]; then
$COMPOSE exec \
-u $WWWUSER \
-u vessel \
app \
./vendor/bin/phpunit "$@"
else
Expand Down

0 comments on commit d1c71e6

Please sign in to comment.