Skip to content

Commit

Permalink
update supervisor schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
amrikarisma committed Dec 14, 2023
1 parent 4be1f47 commit f68bb97
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ RUN addgroup --gid 1000 www \
www

# PHP Error Log Files
RUN mkdir /var/log/php
RUN touch /var/log/php/errors.log && chmod 777 /var/log/php/errors.log
RUN mkdir /var/log/php && touch /var/log/php/errors.log && chmod 777 /var/log/php/errors.log
RUN mkdir /var/bash

# Copy PHP and Nginx config
COPY --chown=root:root supervisor.conf /etc/supervisor/conf.d/supervisord.conf
COPY --chown=root:root php.ini /usr/local/etc/php/conf.d/app.ini
COPY --chown=root:root nginx.conf /etc/nginx/sites-enabled/default
COPY --chown=root:root schedule.sh /var/bash/schedule.sh

RUN chmod +x /var/bash/schedule.sh

# Install Node.js
RUN npm install npm@latest -g
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker build --no-cache -t kentos93/php_vestora:latest . && \
docker build -t kentos93/php_vestora:latest . && \
docker tag kentos93/php_vestora kentos93/php_vestora:$(date +%s) && \
docker push --all-tags kentos93/php_vestora && \
docker rmi -f $(docker images -q kentos93/php_vestora)
5 changes: 5 additions & 0 deletions schedule.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
while [ true ]
do
php /var/www/artisan schedule:run --verbose --no-interaction &
sleep 60
done
2 changes: 1 addition & 1 deletion supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ killasgroup=true
stopasgroup=true
redirect_stderr=true
process_name=%(program_name)s_%(process_num)02d
command = /bin/bash -c "/var/www/docker/schedule.sh"
command = /bin/bash -c "/var/bash/schedule.sh"
stdout_logfile=/var/log/nginx/schedule.log
priority = 20

Expand Down

0 comments on commit f68bb97

Please sign in to comment.