Skip to content

Instantly share code, notes, and snippets.

Avatar
🚵‍♀️

Amirhossein Baghaie ohmydevops

🚵‍♀️
View GitHub Profile
@ohmydevops
ohmydevops / docker.md
Last active May 24, 2021
Docker-course-linux
View docker.md
@ohmydevops
ohmydevops / docker-compose.yml
Created May 11, 2021
Docker registry with Nginx and Let's Encrypt
View docker-compose.yml
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 Apr 29, 2021
Laravel 8 sail configurations for my projects (PHP7.4 + MySQL8.0 + Redis5.0 + PHPMyAdmin5)
View docker-compose.yml
# 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 Feb 17, 2021
jwilder/nginx-proxy with VIRTUAL_HOST and custom locations for routing to different versions of smae container
View jwilder-nginx-proxy-docker-compose.yaml
### 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 Apr 14, 2020
FFMPEG docker alpine
View Dockerfile
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 Apr 14, 2020
Drone CI docker-compose file
View drone-cicd-docker-compose.yaml
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:
View k8s-entity-requirements.md
  • 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
View nginx.yaml
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:
View gitea_backup_convert_timestamps.bash
#! /bin/bash
# clear screen!
clear
# change Time zone to tehran in current process
TZ=Asia/Tehran
# ask for gitea backup directory on your machine
echo -n "Enter gitea backup full path (example: /var/log/gitea/): "
@ohmydevops
ohmydevops / docker.txt
Last active Jul 14, 2019
docker cheat sheet
View docker.txt
docker build -t myimagename .
docker run -p 4000:80 myimagename
docker run -d -p 4000:80 myimagename
docker exec -it [container-id] bash
docker ps
docker stop <hash>
docker ps -a
docker kill <hash>
docker rm <hash>
docker rm $(docker ps -a -q)