Comments (3)
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.
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.
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)
- More typos HOT 4
- PRs fail because of the Nuxt content ENV not being set
- PRs fail because of Docker Logins are not set HOT 5
- I encountered issues with some vulnerabilities but couldn't find a way to update the dependencies. HOT 6
- Adding custom script fails to start HOT 2
- gRPC can't be found anymore! HOT 1
- Nginx Unit Docker Image Exposes Ports 80 and 443 alongside 8080 and 8443? HOT 1
- ⚠️ Delayed release of v3.1.0 HOT 1
- mkdir() "/var/lib/nginx/body" failed (13: Permission denied) HOT 3
- Cannot start SSUPv3 docker image on Google CloudRun HOT 10
- Improve Horizon Support HOT 3
- nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/site-opts.d/https.conf:2
- Apache container fails to restart HOT 5
- CrashLoop in K8s HOT 1
- Custom start up script not executing HOT 1
- Running the image on Azure and other major cloud providers
- Nginx boots up and starts accepting connections when running a non default command.
- nginx apt repository GPG expired HOT 10
- Allow FastCGI parameters to be set via environment variable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-php.