Skip to content

Instantly share code, notes, and snippets.

View chris-cmsoft's full-sized avatar

Chris Vermeulen chris-cmsoft

View GitHub Profile
@chris-cmsoft
chris-cmsoft / install-application.sh
Last active July 8, 2024 10:39
TLDR - Laravel In Kubernetes Part 1
export APP_PORT=8080
# Create a directory to store application
mkdir -p laravel-in-kubernetes-tutorial
cd laravel-in-kubernetes-tutorial
# Create Laravel application
curl -s "https://laravel.build/laravel-in-kubernetes?with=mysql,redis" | bash
cd laravel-in-kubernetes
@chris-cmsoft
chris-cmsoft / .dockerignore
Last active October 8, 2023 13:36
TLDR - Laravel In Kubernetes Part 2
/vendor
/node_modules
@chris-cmsoft
chris-cmsoft / Makefile
Last active October 26, 2021 22:41
TLDR - Laravel In Kubernetes Part 3
# VERSION defines the version for the docker containers.
# To build a specific set of containers with a version,
# you can use the VERSION as an arg of the docker build command (e.g make docker VERSION=0.0.2)
VERSION ?= v0.0.1
# REGISTRY defines the registry where we store our images.
# To push to a specific registry,
# you can use the REGISTRY as an arg of the docker build command (e.g make docker REGISTRY=my_registry.com/username)
# You may also change the default value if you are using a different registry as a default
REGISTRY ?= registry.gitlab.com/laravel-in-kubernetes/laravel-app
@chris-cmsoft
chris-cmsoft / .gitignore
Created August 28, 2021 22:22
TLDR - Laravel In Kubernetes Part 4
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
@chris-cmsoft
chris-cmsoft / apply-database.sh
Created October 26, 2021 22:44
TLDR - Laravel in Kubernetes Part 5
terraform apply
@chris-cmsoft
chris-cmsoft / AppServiceProvider.php
Created October 28, 2021 07:45
Laravel - Switch off sql_require_primary_key for DigitalOcean managed database
# app/Providers/AppServiceProvider.php
public function register()
{
// https://github.com/laravel/framework/issues/33238#issuecomment-897063577
Event::listen(MigrationsStarted::class, function () {
DB::statement('SET SESSION sql_require_primary_key=0');
});
Event::listen(MigrationsEnded::class, function () {
DB::statement('SET SESSION sql_require_primary_key=1');
@chris-cmsoft
chris-cmsoft / .env
Created October 28, 2021 07:52
Laravel - Add stdout logging channel
# .env
LOG_CHANNEL=stdout