Skip to content

Instantly share code, notes, and snippets.

View arsalanses's full-sized avatar
🧠
lets play chess

Arsalan Sefidgar arsalanses

🧠
lets play chess
View GitHub Profile
@arsalanses
arsalanses / decrypt.sh
Last active February 8, 2025 08:54
nerdctl image encrypt
#!/bin/sh
set -x
nerdctl pull --unpack=false reg.example.ir/nginx:encrypted
nerdctl image decrypt --key=dockerkey.pem reg.example.ir/nginx:encrypted reg.example.ir/nginx:decrypted
services:
nginx:
image: nginx:1.27
restart: always
#ports:
# - "80:80"
volumes:
- ./conf.d/tgapi.conf:/etc/nginx/conf.d/tgapi.conf
# - ./conf.d/nginx.conf:/etc/nginx/nginx.conf
# - ./log:/var/log/nginx
@arsalanses
arsalanses / compose.yml
Created January 7, 2025 19:29
phpmyadmin
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:5.2
container_name: phpmyadmin
environment:
PMA_HOST: db
PMA_PORT: 3306
PMA_ARBITRARY: 0
depends_on:
- db
@arsalanses
arsalanses / promtail_docker_logs.md
Created December 14, 2024 08:06 — forked from ruanbekker/promtail_docker_logs.md
Docker Container Logging using Promtail
@arsalanses
arsalanses / compose.yml
Created November 25, 2024 06:16
telegram bot api proxy
services:
nginx:
image: nginx:bookworm
container_name: "nginx"
restart: always
#ports:
# - "80:80"
volumes:
- ./conf.d:/etc/nginx/conf.d
# - ./log:/var/log/nginx
@arsalanses
arsalanses / compose.yml
Created November 24, 2024 13:51
dnsmasq
services:
dnsmasq:
image: dockurr/dnsmasq
container_name: dnsmasq
environment:
DNS1: "1.0.0.1"
DNS2: "1.1.1.1"
ports:
- 5353:53/udp
- 5353:53/tcp
@arsalanses
arsalanses / docker-config.sh
Created October 31, 2024 09:03
docker swarm config service update
#!/bin/bash
set -xue
OLD_CONFIG=$(docker service inspect service_name | jq .[].Spec.TaskTemplate.ContainerSpec.Configs[].ConfigName)
OLD_VERSION=${OLD_CONFIG: -2:-1}
NEW_VERSION=$((OLD_VERSION + 1))
NEW_CONFIG=$(echo "$OLD_CONFIG" | sed "s/$OLD_VERSION/$NEW_VERSION/")
echo "NEW_CONFIG: $NEW_CONFIG"
@arsalanses
arsalanses / ReadMe.md
Created October 22, 2024 12:07
kubernetes setup external load-balancer

haproxy and keepalived install and configuration

On API loadbalancer nodes

echo "install haproxy and keepalived service"
apt install -y haproxy keepalived

echo "copy and move haproxy config"
cat /etc/haproxy/haproxy.cfg
cat <<EOT >> /etc/haproxy/haproxy.cfg
listen Stats-Page
@arsalanses
arsalanses / default.conf
Created October 20, 2024 20:38
nginx mirror
upstream backend {
server echo01:5678;
}
upstream test_backend {
server echo02:5678;
}
server {
server_name 192.168.0.100;
@arsalanses
arsalanses / compose.yml
Created October 7, 2024 19:52
opengist
services:
caddy:
image: docker.arvancloud.ir/caddy:2.8-alpine
restart: unless-stopped
command: caddy reverse-proxy --access-log --from https://git.domain.com:443 --to http://opengist:6157 { metrics /metrics }
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes: