I am not sure if I can use laravel sail in production. First question is, can I use laravel sail in production?
And if I can, how can I use laravel sail in production? I am trying to deploy a website using laravel sail. But when I try to execute sail up command, it says Docker is not running. But when I check systemctl status docker, it says Docker is running.
What do I need to do?
Laravel Sail is a development environment so I don't think it's meant for production.
https://laravel.com/docs/8.x/sail#introduction
Docker cannot start on Windows
cmd
"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
power shell
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
Related
env: macOS 12.6.3
Docker, Composer, PHP installed
Hello, I’m wondering if you have to manually install sail using
php artisan sail:install
every time I create projects.
Although I have installed laravel projects several times successfully, now it says “no configuration file provided: not found” when sail up when installing a new project and sail up. And there’s no docker-compose.yml file.
The question is that I need to manually install sail every time I make Laravel projects despite the fact that it did automatically installed sail before.
Thank you.
I have tried
php artisan sail:install
I have been using Laravel Vapor for several years now using native runtimes and have never had an issue until recently when needing to use the Imageick PHP extension. Native runtimes don't support PHP extensions so I decided to try using a docker runtime on a staging server and everything went smoothly until I tried to run the migrate command in the Vapor UI. Getting the following error in Vapor-UI:
sh: /opt/bin/php: not found
Have tried unsuccessfully searching for the location of php in the staging deployment as well as adding alias for php in my dockerfile. Here is my current staging.Dockerfile:
ARG VERSION=php81
FROM laravelphp/vapor:${VERSION}
RUN apk add imagemagick imagemagick-dev php81-pecl-imagick \
&& pecl install imagick \
&& docker-php-ext-enable imagick
COPY . /var/task
Has anyone run in to this issue before? Seems too simple but I have zero experience with Docker and after reading through some documentation I could understand why it wouldn't be available, but then during deployment on vapor I would have thought there would be issues... and if its not available is there any way to access php in the Vapor UI by adding something to the Dockerfile or elsewhere?
I am building a laravel environment with docker.
I want to run the php artisan command.
Laravel v9 fails to run because it runs on the global 7.4 instead of the php version 8.1.4 running in the container.
How can I get php 8.1.4 to start?
Laravel is running from the following DLL image.
https://hub.docker.com/r/bitnami/laravel
Hi i tried to install fresh Laravel project using
Laravel Sail
docker environment. First it was showing me "Docker is not running" error. Then i found out, i needed to start docker as rootless. I solved it, reading this url: [https://docs.docker.com/engine/install/linux-postinstall/].
After that, I successfully installed Laravel using Laravel Sail. Then I ran
./vendor/bin/sail up -d
I was able to view Laravel project in my browser. But when i ran any other artisan commands such as ./vendor/bin/sail artisan route:list or sail commands as sail shell, all the docker containers were forced closed automatically. It shows me this error.
Sail is not running.
You may Sail using the following commands: './sail up' or './sail up
-d'
Any suggestions? I am getting this issue on Ubuntu 20.04 LTS version.
If you are on Windows and using WSL, make sure the WSL Integration is properly set:
Settings->Ressources->WSL Integration + Toggle Linux version
I was using Laradock before installing Laravel Sail. Maybe there were some conflicts. So I backed up all my databases, then I removed all containers using this code. sudo docker rmi -f $(docker images -a -q). Then installed fresh Laravel project and it worked.
Please read my below comment as it is was a better solution for me.
very easy, maybe you don't have permission to run docker.
in Linux first use sudo -s and after user ./vendor/bin/sail up -d
Sail first checks to see if any current docker-compose processes have a status of Exit. If any of them have, then it will forcefully bring down all other services. Which is what you were are seeing whenever you type any sail sub-command. You can see the code here: https://github.com/laravel/sail/blob/87c63c2956749f66e43467d4a730b917ef7428b7/bin/sail#L44-L49
Run sail up to start the processes and then use docker-compose ps to check all services are running and none have an Exit status.
I had the same issue and when reviewing the code and checking my services I noticed the database had exited soon after I brought them up.
Trying to fire up a Laravel api and Nuxt app on the actual server by running
lets say server IP is - 10.66.22.41
npm run dev
php artisan serve --port=8001
This obviously worked on my local environment but since this is in the actual server and I am not too familiar with Centos, is there anything I should be doing different?
When I run npm run serve I get http://localhost:3001/
When I run php artisan serve --port=8001 i get http://127.0.0.1:8001
dumb question:
How should I be accessing this on the browser?
for Nuxt, added your script in package.json
"scripts": {
"dev:host": "nuxt --host 'IP-Address' --port 3001",
}
Run:
dev:host": "nuxt --host 'IP-Address' --port 3001
For Laravel:
php artisan serve --host=IP-Address --port=8001
Quick point though, What Khali should be the best practive but if you want to test or whatever you need to do , this is it.
Well, the artisan serve command, will keep the server running until you close the console, which will terminate the service! It is not an ideal setup... I would recommend that you install a webserver of some sort, and install laravel properly via composer. We cannot see how you installed NPM, or if you installed Apache? etc..
I would recommend to install centos webpanel for a starter:
http://centos-webpanel.com/
Then install composer https://linuxize.com/post/how-to-install-and-use-composer-on-centos-7/
Then install laravel using: https://laravel.com/docs/8.x/installation#installing-laravel
This is your best way to manage and run laravel on centos properly (for beginners), if you have the money for it, you should buy CPanel (https://cpanel.net/pricing/) instead of Centos WebPanel, as it offers more flexibility and features.
Good luck!