Skip to content

Instantly share code, notes, and snippets.

View stefanopascazi's full-sized avatar

Stefano stefanopascazi

View GitHub Profile
@stefanopascazi
stefanopascazi / keycloak-docker-compose.yml
Last active June 22, 2022 09:36
Sample docker-compose for deploy a local Keycloak application
version: '2'
services:
postgresql:
image: docker.io/bitnami/postgresql:11
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- POSTGRESQL_USERNAME=bn_keycloak
- POSTGRESQL_DATABASE=bitnami_keycloak
volumes:
@stefanopascazi
stefanopascazi / proxy.sh
Last active June 8, 2022 13:35
Create nginx-proxy container with acme-companion for auto create a valid Lets Encrypt certificate
#/bin/bash
echo "Create docker network nginx-proxy"
docker network create nginx-proxy
echo "Create conf.d folder in {$PWD}"
mkdir -p $PWD/conf.d
@stefanopascazi
stefanopascazi / dump-restore.sh
Created February 10, 2022 09:45
Dump Or Restore MySQL from a container
#!/bin/bash
## mysqldump
docker exec -i CONTAINER_NAME /usr/bin/mysqldump -u DB_USER -p'DB_PASS' DB_NAME > dump.sql
## Restore
cat dump.sql | docker exec -i CONTAINER_NAME /usr/bin/mysql -u DB_USER -p'DB_PASS' DB_NAME
@stefanopascazi
stefanopascazi / stencil.d.ts
Created February 10, 2022 09:40
Declaration file for React web components created by stencil
import { JSX as LocalJSX } from "@stencil/core";
import { DetailedHTMLProps, HTMLAttributes } from 'react';
type StencilProps<T> = {
[P in keyof T]?: Omit<T[P], 'ref'>;
};
type ReactProps<T> = {
[P in keyof T]?: DetailedHTMLProps<HTMLAttributes<T[P]>, T[P]>;
};
@stefanopascazi
stefanopascazi / nextjs.Dockerfile
Last active February 10, 2022 09:39
Dockerfile for build NextJS application
# Double-container Dockerfile for separated build process.
# If you're just copy-pasting this, don't forget a .dockerignore!
# We're starting with the same base image, but we're declaring
# that this block outputs an image called DEPS that we
# won't be deploying - it just installs our Yarn deps
FROM node:16.13.0-alpine AS deps
# If you need libc for any of your deps, uncomment this line:
# RUN apk add --no-cache libc6-compat