Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrgroot committed Sep 27, 2020
1 parent 66e0038 commit 34c1f2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ RUN apt-get install --yes nodejs build-essential > /dev/null
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u 1234 -d /home/laravel laravel
RUN mkdir -p /home/laravel/.composer
RUN chown -R laravel:laravel /home/laravel

# Start script
COPY start.sh /usr/local/bin/start
RUN chmod u+x /usr/local/bin/start
RUN chown -R laravel:laravel /usr/local/bin/start
COPY start.sh /home/laravel/start

# Permission
RUN chown -R laravel:laravel /home/laravel
RUN chmod +x /home/laravel/start

# Set working directory
WORKDIR /var/www

USER laravel

CMD ["/usr/local/bin/start"]
CMD ["/home/laravel/start"]
4 changes: 3 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ role=${CONTAINER_ROLE:-app}

if [ "$role" = "app" ]; then

exit 0
echo "Running the main app..."
php-fpm -F

elif [ "$role" = "queue" ]; then

Expand All @@ -15,6 +16,7 @@ elif [ "$role" = "queue" ]; then

elif [ "$role" = "scheduler" ]; then

echo "Running the scheduler every minute..."
while [ true ]
do
php /var/www/artisan schedule:run --verbose --no-interaction &
Expand Down

0 comments on commit 34c1f2f

Please sign in to comment.