Skip to content

Instantly share code, notes, and snippets.

View ohmydevops's full-sized avatar
🚵‍♀️

Amirhossein Baghaie ohmydevops

🚵‍♀️
View GitHub Profile
@ohmydevops
ohmydevops / data.json
Last active November 17, 2023 05:43
Mashhad LUG 268
{
"users": [
{
"id": 1,
"name": "Alice",
"age": 28,
"status": "active",
"books": [
"Test",
"Good",
@ohmydevops
ohmydevops / 01nginx-tls-sni.md
Created April 16, 2023 22:35 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@ohmydevops
ohmydevops / docker.md
Last active May 24, 2021 20:07
Docker-course-linux
@ohmydevops
ohmydevops / docker-compose.yml
Created May 11, 2021 10:09
Docker registry with Nginx and Let's Encrypt
version: '3.8'
services:
registry:
restart: always
image: registry:2.7.1
container_name: registry
environment:
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
@ohmydevops
ohmydevops / docker-compose.yml
Last active April 29, 2021 10:38
Laravel 8 sail configurations for my projects (PHP7.4 + MySQL8.0 + Redis5.0 + PHPMyAdmin5)
# For more information: https://laravel.com/docs/sail
version: '3'
services:
laravel.test:
container_name: sail-laravel
build:
context: ./vendor/laravel/sail/runtimes/7.4
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
@ohmydevops
ohmydevops / jwilder-nginx-proxy-docker-compose.yaml
Last active October 22, 2023 19:43
jwilder/nginx-proxy with VIRTUAL_HOST and custom locations for routing to different versions of smae container
### I got the idea from here:
### https://stackoverflow.com/questions/39514293/docker-nginx-proxy-how-to-route-traffic-to-different-container-using-path-and-n
version: '3.8'
services:
nginx-proxy:
image: jwilder/nginx-proxy:alpine
ports:
@ohmydevops
ohmydevops / Dockerfile
Created April 14, 2020 11:34
FFMPEG docker alpine
FROM gliderlabs/alpine:3.3
ENV FFMPEG_VERSION=4.0.5
WORKDIR /tmp/ffmpeg
RUN apk add --update build-base curl file nasm tar bzip2 \
zlib-dev openssl-dev yasm-dev lame-dev libogg-dev x264-dev libvpx-dev libvorbis-dev x265-dev freetype-dev libass-dev libwebp-dev rtmpdump-dev libtheora-dev opus-dev && \
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz | tar zxvf - -C . && \
@ohmydevops
ohmydevops / drone-cicd-docker-compose.yaml
Last active April 14, 2020 11:28
Drone CI docker-compose file
version: '3'
services:
drone-server:
container_name: drone-server
image: drone/drone:1.6
volumes:
- ./drone_data:/var/lib/drone/
- /var/run/docker.sock:/var/run/docker.sock
ports:
  • apiVersion: Which version of the Kubernetes API you’re using to create this object
  • kind: What kind of object you want to create
  • metadata: Data that helps uniquely identify the object, including a name string, UID, and optional namespace
  • spec: What state you desire for the object
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template: