Skip to content

Instantly share code, notes, and snippets.

Avatar

Damian Naprawa dnaprawa

View GitHub Profile
@dnaprawa
dnaprawa / nginxproxy.md
Created May 13, 2021 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@dnaprawa
dnaprawa / README.md
Last active Apr 24, 2021
Elasticsearch with nginx proxy - Kubernetes
View README.md
apiVersion: apps/v1
kind: Deployment
metadata:
  name: elasticsearch
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: elasticsearch
  template:
@dnaprawa
dnaprawa / README.md
Last active Apr 21, 2021
Kubernetes Dashboard with Metrics Server
View README.md

Install Kubernetes Dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml

Patch the dashboard to allow skipping login

kubectl patch deployment kubernetes-dashboard -n kubernetes-dashboard --type 'json' -p '[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--enable-skip-login"}]'
@dnaprawa
dnaprawa / README.md
Created Feb 1, 2021
Install Docker & docker-compose on Ubuntu/Debian
View README.md

Create a .sh file - eg. docker-install.sh and paste following:

#!/bin/bash

sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
@dnaprawa
dnaprawa / docker-nfs-volumes.md
Created Jan 27, 2021 — forked from ruanbekker/docker-nfs-volumes.md
NFS Volumes with Docker Swarm
View docker-nfs-volumes.md

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@dnaprawa
dnaprawa / README.md
Last active Apr 29, 2022
Using Docker on remote Docker Host with docker context
View README.md

Working on remote Docker Host using docker context

SSH keys on Windows

In order to use remote Docker host, as a prerequisite you need SSH enabled (required login using SSH keys).

Generate or find your public SSH key

Go to C:\Users\YOUR_USERNAME\.ssh and copy content of id_rsa.pub file

@dnaprawa
dnaprawa / minecraft-in-docker.md
Last active Nov 22, 2020
Running Minecraft Server using Docker (and docker-compose)
View minecraft-in-docker.md

Running Minecraft Server using Docker (and docker-compose)

With over 126 million monthly users, 200 million games sold & 40 million MAU, Minecraft still remains one of the biggest games on the planet.

Why minecraft inside Docker?

  • for fun of course! :)
  • can be run locally for your kids
  • you can run it on popular and low-cost Rasperry PI inside your home and/or in the cloud
@dnaprawa
dnaprawa / README.md
Last active Aug 16, 2022
Apple M1 workaround for Docker
View README.md

Apple M1 workaround for Docker

Prerequisites

You need a dedicated Linux machine (linux-vm) (in the cloud or on your VPS, or bare-metal) with Docker installed and SSH enabled (required login using SSH keys).

Workaround for people who have SSH access to a docker installed linux machine

Install go (pre-compiled binaries at https://golang.org/dl/

(Edit: there are no Darwin arm64 yet, You need to compile or use Homebrew...)

@dnaprawa
dnaprawa / docker-compose.yml
Created Jul 2, 2020
Sample YAML file to run MySQL & phpMyAdmin using Docker (docker-compose)
View docker-compose.yml
version: '3.7'
services:
phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin/phpmyadmin:latest
restart: always
ports:
- 8081:80