-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Big update (with PHP 8.2, PostgreSQL 16, Node 20, Mailpit), n…
…ew Makefile ...
- Loading branch information
Showing
11 changed files
with
189 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,91 @@ | ||
build: | ||
docker-compose -f docker-compose-production.yml build | ||
default: help ## Display help | ||
|
||
build-dev: | ||
docker-compose build | ||
artisan: ## Laravel Artisan command add arg="command" to run a specific command (ex: make artisan arg="migrate") | ||
docker compose exec php php artisan $(arg) | ||
|
||
composer-install: | ||
docker-compose exec php composer install --optimize-autoloader --no-suggest --no-dev | ||
artisan-migrate: ## Laravel Artisan migrate | ||
docker compose exec php php artisan migrate | ||
|
||
composer-install-dev: | ||
docker-compose run --rm php composer install | ||
artisan-migrate-fresh: ## Laravel Artisan migrate:fresh | ||
docker compose exec php php artisan migrate:fresh | ||
|
||
composer-update: | ||
docker-compose run --rm php composer update | ||
artisan-migrate-seed: ## Laravel Artisan migrate:fresh --seed | ||
docker compose exec php php artisan migrate:fresh --seed | ||
|
||
database-migrate: | ||
docker-compose run --rm php php artisan migrate --force | ||
artisan-key-generate: ## Laravel Artisan key:generate | ||
docker compose exec php php artisan key:generate | ||
|
||
database-seed: | ||
docker-compose run --rm php php artisan migrate:fresh --seed | ||
|
||
down: | ||
docker-compose exec php php artisan down --refresh=15 | ||
|
||
ide-helper: | ||
docker-compose run --rm php php artisan ide-helper:eloquent | ||
docker-compose run --rm php php artisan ide-helper:generate | ||
docker-compose run --rm php php artisan ide-helper:meta | ||
docker-compose run --rm php php artisan ide-helper:models --nowrite | ||
artisan-storage: | ||
docker-compose run --rm php php artisan storage:link | ||
|
||
git-pull: | ||
git reset --hard | ||
git pull origin main | ||
build: ## Build containers | ||
docker compose build | ||
|
||
install: build composer-install laravel-storage | ||
composer: ## Composer command add arg="command" to run a specific command (ex: make composer arg="require laravel/ui") | ||
docker compose run --rm php composer $(arg) | ||
|
||
install-dev: build-dev composer-install-dev laravel-storage | ||
composer-install-dev: ## Composer install dev | ||
docker compose run --rm php composer install | ||
|
||
laravel-install: | ||
docker-compose run --rm php composer create-project laravel/laravel laravel --prefer-dist | ||
mv README.md README-docker.md | ||
-mv -f ./laravel/* ./laravel/.* ./ | ||
-rm -rf ./laravel | ||
composer-install-prod: ## Composer install prod | ||
docker compose run --rm php composer install --optimize-autoloader --no-suggest --no-dev | ||
|
||
laravel-cache: | ||
docker-compose exec php php artisan cache:clear | ||
docker-compose exec php php artisan config:cache | ||
docker-compose exec php php artisan event:cache | ||
docker-compose exec php php artisan route:cache | ||
docker-compose exec php php artisan view:cache | ||
composer-update: ## Composer update | ||
docker compose run --rm php composer update | ||
|
||
laravel-storage: | ||
docker-compose run --rm php php artisan storage:link | ||
copy-env: ## Copy .env.example to .env | ||
cp .env.example .env | ||
|
||
pull: | ||
docker-compose -f docker-compose-production.yml pull | ||
copy-docker-compose-dev: ## Copy docker-compose.dev.yml to docker-compose.yml | ||
cp docker-compose.dev.yml docker-compose.yml | ||
|
||
pull-dev: | ||
docker-compose pull | ||
down: ## Stop and remove all containers | ||
docker compose down --remove-orphans | ||
@echo "🛑 Project are stopped and removed" | ||
|
||
restart: stop start | ||
eslint: ## Run eslint | ||
docker compose run --rm node npm run eslint | ||
|
||
restart-dev: stop-dev start-dev | ||
install: copy-docker-compose-dev upgrade laravel-install copy-env up npm-install artisan-key-generate artisan-storage ## Install Project | ||
@echo "✅ Project is installed and running, edit .env" | ||
|
||
start: | ||
docker-compose -f docker-compose-production.yml up -d | ||
git-pull: | ||
git reset --hard | ||
git pull origin --no-rebase | ||
|
||
start-dev: | ||
docker-compose up -d | ||
help: ## Display this help | ||
@echo "📖 Project help" | ||
@echo "✍️ Usage: make [command]" | ||
@echo "👉 Available commands open Makefile to see all commands" | ||
|
||
stop: | ||
docker-compose -f docker-compose-production.yml down --remove-orphans | ||
laravel-install: ## Install Laravel | ||
docker-compose run --rm php composer create-project laravel/laravel laravel --prefer-dist | ||
mv README.md README-docker.md | ||
-mv -f ./laravel/* ./laravel/.* ./ | ||
-rm -rf ./laravel | ||
|
||
stop-dev: | ||
docker-compose down --remove-orphans | ||
npm: ## Npm command add arg="command" to run a specific command (ex: make npm arg="install") | ||
docker compose run --rm node npm $(arg) | ||
|
||
tinker: | ||
docker-compose exec php php artisan tinker | ||
npm-install: ## Npm install | ||
docker compose run --rm node npm install | ||
|
||
test: | ||
docker-compose exec php php artisan config:clear | ||
docker-compose exec php php artisan test | ||
npm-update: ## Npm update | ||
docker compose run --rm node npm update | ||
|
||
test-create: | ||
docker-compose run --rm php php artisan make:test $(name) | ||
up: ## Create and start all containers | ||
docker compose up -d | ||
@echo "✅ Project is up and running" | ||
|
||
up: | ||
docker-compose exec php php artisan up | ||
upgrade: pull build ## Upgrade containers (pull and build) | ||
|
||
update: down git-pull composer-install laravel-cache database-migrate up | ||
upgrade-dev: down copy-docker-compose-dev upgrade up composer-install-dev npm-install ## Upgrade Project with docker-compose.dev.yml | ||
|
||
update-dev: down git-pull-dev composer-install-dev database-migrate up | ||
pint: ## Run Laravel Pint | ||
docker compose run --rm php ./vendor/bin/pint | ||
|
||
upgrade: stop git-pull pull build composer-install laravel-cache database-migrate start | ||
pull: ## Pull all containers | ||
docker compose pull | ||
|
||
upgrade-dev: stop-dev git-pull pull-dev build-dev composer-install-dev database-migrate start-dev | ||
setup-dev: copy-docker-compose-dev copy-env upgrade composer-install-dev npm-install artisan-key-generate artisan-migrate | ||
@echo "✅ Project is installed, edit .env and you can now run 'make up' to start containers" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
services: | ||
php: | ||
build: | ||
context: ./docker/php/ | ||
dockerfile: dev.Dockerfile | ||
ports: | ||
- 80:80 | ||
volumes: | ||
- ./:/app/ | ||
extra_hosts: | ||
- 'host.docker.internal:host-gateway' | ||
depends_on: | ||
- pgsql | ||
node: | ||
image: node:20 | ||
ports: | ||
- 5173:5173 | ||
volumes: | ||
- ./:/app/ | ||
working_dir: /app/ | ||
command: "npm run dev" | ||
# mariadb: | ||
# image: mariadb:11 | ||
# ports: | ||
# - 3306:3306 | ||
# environment: | ||
# MARIADB_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}" | ||
# MARIADB_DATABASE: "${DB_DATABASE}" | ||
# MARIADB_USER: "${DB_USERNAME}" | ||
# MARIADB_PASSWORD: "${DB_PASSWORD}" | ||
# volumes: | ||
# - ./docker/mariadb/datas:/var/lib/mysql | ||
pgsql: | ||
image: postgres:16 | ||
ports: | ||
- '${FORWARD_DB_PORT:-5432}:5432' | ||
environment: | ||
PGPASSWORD: '${DB_PASSWORD:-secret}' | ||
POSTGRES_DB: '${DB_DATABASE:-laravel}' | ||
POSTGRES_USER: '${DB_USERNAME:-laravel}' | ||
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}' | ||
volumes: | ||
- './docker/pgsql/datas:/var/lib/postgresql/data' | ||
healthcheck: | ||
test: [ "CMD", "pg_isready", "-q", "-d", "${DB_DATABASE:-laravel}", "-U", "${DB_USERNAME:-laravel}" ] | ||
mailpit: | ||
image: axllent/mailpit:latest | ||
ports: | ||
- 1025:1025 | ||
- 8025:8025 |
Oops, something went wrong.