The goal of this project is to serve as a boilerplate for Laravel 10 utilizing light-weight alpine linux images for nginx and php 8.2 (fpm) while keeping the front-end stuff as containerized as possible.
While this isn't to my taste it might be a good place to start if you're js/ts-interested but not committed to learning Vue directly.
Stack:
- app @ php:8.2-fpm-alpine
- nginx @ nginx:alpine
- mysql @ mysql
- redis @ redis:alpine
- worker-local @ php:8.2-alpine3.16
- figure out where else VITE_PORT is used. https://news.ycombinator.com/item?id=32085349
- hook up worker-local so you have a queue to play with
- create an example job/worker you might co-locate on same hardware
- maybe add some ci/cd and even k8s stuff as an example to scale out workers/nginx/edges
- docker/app docker/nginx will rely on supervisor to maintain their processes, yawn
- Please see .env "#PORT FORWARDS" before starting in docker-compose
The default docker-compose config here exposes ports if you want them. See .env's "PORT FORWARDS"
cp ./env.example ./.env
docker-compose up --build -d app nginx mysql
docker-compose exec app php artisan migrate
# grab a shell inside docker/app
docker-compose exec -u root app /bin/sh
# then, inside shell
npm install
# vite
npm run dev -- --host
You can now access http://localhost:8022 (or whatever your FORWARD_NGINX_PORT is).
Please keep ./composer.lock in docker/app container context, for example:
docker-compose exec -u root app /bin/sh
# then...
# COMPOSER_MEMORY_LIMIT=-1 app composer install
# COMPOSER_MEMORY_LIMIT=-1 app composer require awesome/package_etc
# ymmv w/ COMPOSER_MEMORY_LIMIT maybe try without