Giter Club home page Giter Club logo

Comments (3)

jaydrogers avatar jaydrogers commented on June 20, 2024

You need to ensure you're copying the artisan file and all other Laravel files with the proper permissions:

COPY --chown=www-data:www-data . /var/www/html

See this example for more: https://serversideup.net/open-source/docker-php/docs/guide/migrating-from-v2-to-v3#cicd

If you have further questions, please open up a "Q&A" discussion item under "Discussions" instead of "Issues": https://github.com/serversideup/docker-php/discussions

from docker-php.

jaydrogers avatar jaydrogers commented on June 20, 2024

Also, since you're writing your own S6 service, you may want to look into calling docker-php-serversideup-s6-init https://serversideup.net/open-source/docker-php/docs/customizing-the-image/adding-your-own-start-up-scripts#docker-php-serversideup-s6-init-usage

from docker-php.

MasterZydra avatar MasterZydra commented on June 20, 2024

You need to ensure you're copying the artisan file and all other Laravel files with the proper permissions:

COPY --chown=www-data:www-data . /var/www/html

See this example for more: https://serversideup.net/open-source/docker-php/docs/guide/migrating-from-v2-to-v3#cicd

If you have further questions, please open up a "Q&A" discussion item under "Discussions" instead of "Issues": https://github.com/serversideup/docker-php/discussions

Thanks for the fast reply.

I have only copied a part of my dockerfile in the description above, sorry. In the dockerfile I copy the whole laravel project including artisan and fix the permission.

FROM serversideup/php:8.3-fpm-apache

WORKDIR /var/www/html

COPY . .

USER root

RUN apt-get update ; \
    apt-get -y upgrade ; \
    # Rename env.example so that .env exists
    cp .env.example .env ; \
    # Fix permissions
    chown -R www-data:www-data /var/www/html ; \
    # Add start of laravel schedule
    mkdir -p /etc/s6-overlay/s6-rc.d/laravel-schedule ; \
    echo "#!/usr/bin/bash" >> /etc/s6-overlay/s6-rc.d/laravel-schedule/run ; \
    echo "php /var/www/html/artisan schedule:work --run-output-file=/var/www/html/schedule.log" >> /etc/s6-overlay/s6-rc.d/laravel-schedule/run ; \
    echo "longrun" >> /etc/s6-overlay/s6-rc.d/laravel-schedule/type ; \
    echo "50-laravel-automations" >> /etc/s6-overlay/s6-rc.d/laravel-schedule/dependencies ; \
    touch /etc/s6-overlay/s6-rc.d/user/contents.d/laravel-schedule

USER www-data

EXPOSE 8080

I have found the issue after reviewing my changes again:
Before:

cd /var/www/html && php /var/www/html/artisan schedule:work --run-output-file=/var/www/html/schedule.log

After

php /var/www/html/artisan schedule:work --run-output-file=/var/www/html/schedule.log

from docker-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.