jhonoryza / serversideup-laravel

base image using image from serversideup/php this single docker image already contains nginx, php-fpm, scheduler and queue (worker or horizon) all this process worked using s6-overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Single Docker Image Alternative

base image using image from serversideup/php this single docker image already contains nginx, php-fpm, scheduler and queue (worker or horizon) all this process worked using s6-overlay

Getting Started

  • clone this repository

    git clone https://github.com/jhonoryza/serversideup-laravel.git
    cd serversideup-laravel
  • clone your laravel app repository to src folder

    composer create-project laravel/laravel src
  • create env file, and fill it with your laravel env variables

  • check docker-compose.yml file, you can adjust networks, ports, image and container name as you want

  • build docker image run ./build.sh or run with argument bash build.sh laravel-app:latest 8.0 n n

  • running the container

  docker-compose up -d
  • to stop the container
  docker-compose down

Running artisan command

  • you need to login to the container using this command
  docker exec -it -u webuser laravel-app bash

which laravel-app is the container name, you need to change these if you change the container name

  • some common artisan commands:
  php artisan key:generate
  php artisan clear-compiled
  php artisan optimize
  php artisan cache:clear 
  php artisan config:clear 
  php artisan route:clear 
  php artisan view:clear 
  
  php artisan livewire:publish --assets
  php artisan livewire:discover

Some reference about s6-overlay

Screenshot ps -ax from the container

image

About

base image using image from serversideup/php this single docker image already contains nginx, php-fpm, scheduler and queue (worker or horizon) all this process worked using s6-overlay


Languages

Language:Dockerfile 51.4%Language:Shell 48.6%