DEV Community

StuartCreed
StuartCreed

Posted on • Edited on

5

Using Laravel Sail (docker composer for Laravel) on a existing application

sources: https://laravel.com/docs/8.x/sail#installation and https://laracasts.com/series/whats-new-in-laravel-8/episodes/12
requirements: Your project must be using Laravel 8

Install docker: https://docs.docker.com/get-docker/
run: composer require laravel/sail --dev
run: php artisan sail:install
run: ./vendor/bin/sail up

That's it! Gets rid of the errors that occur with homebrew and valet sometimes and isolates your app from your local machine. It is a docker compose set up basically, so you can cd into your proj folder and run docker compose up and this will do the same as ./vendor/bin/sail up - or you can use your docker GUI to stop and start sail.

Other useful link: https://mattstauffer.com/blog/how-to-use-takeout-to-add-new-services-to-laravel-sail-and-save-ram/

If a port is already taken (which is an error that may occur when you run ./vendor/bin/sail up) you can specify a different port to use. e.g. if you are using port 3306 for mariadb on your mac then you can use 3307 for mariadb with your container instead by editing your docker-compose.yml file: Alt Text

If the APP Port is in use and you cannot stop it you can run it on a different port instead:

APP_PORT=89 sail up

for example to change it from port 80 to 89 OR do the following in the docker-compose.yml file to avoid typing the app port every time:

# - '${APP_PORT:-80}:80' # WHAT IS WAS BEFORE
  - "8084:80"
Enter fullscreen mode Exit fullscreen mode

Though bear in mind that you will have to view the port using the new port number: i.e. http://localhost:8084/ instead of the default http://localhost:8080/

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (2)

Collapse
 
rf14 profile image
Arif Zuhairi

i have been looking for this

Collapse
 
pudgeline profile image
Abolhasan Momeni

should I build image after develop app ?

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay