Skip to content

Instantly share code, notes, and snippets.

View AlperRehaYAZGAN's full-sized avatar
🏠
Working from home

alperreha AlperRehaYAZGAN

🏠
Working from home
View GitHub Profile
@AlperRehaYAZGAN
AlperRehaYAZGAN / elastic-docker-compose.yaml
Created August 26, 2022 07:12
Simple single node elastic compose yaml
version: "3.7"
services:
elasticsearch:
image: "docker.elastic.co/elasticsearch/elasticsearch:7.8.1"
environment:
discovery.type: "single-node"
cluster.name: "cluster-1"
node.name: "node-1"
version: '3'
services:
# rabbitmq service
rabbitmqapp:
image: rabbitmq:3.10.0-rc.1-management-alpine
networks:
- alyafnnet
ports:
- "5672:5672"
version: '3'
services:
redis:
image: redis:7.0.4-alpine
networks:
- alyafnnet
volumes:
- ./volumes/redis:/data
@AlperRehaYAZGAN
AlperRehaYAZGAN / docker-log-truncate.sh
Last active June 28, 2022 10:26
This is the simple shell command for refresh docker container logs by container id.
# see log sizes
# https://stackoverflow.com/questions/59765204/how-to-list-docker-logs-size-for-all-containers
sudo du -h $(docker inspect --format='{{.LogPath}}' $(docker ps -qa))
# truncate file to refresh
sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' container-id )
@AlperRehaYAZGAN
AlperRehaYAZGAN / docker-compose.yaml
Last active June 21, 2022 14:20
This is the Gitlab CI Docker Runner Exmaple Node Docker Compose Yaml File. (Originally cloned from https://forum.gitlab.com/t/example-gitlab-runner-docker-compose-configuration/67344)
# docker volume create gitlab-runner-config
version: "3.5"
services:
dind:
image: docker:20-dind
restart: always
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
@AlperRehaYAZGAN
AlperRehaYAZGAN / xampp_docker-compose.md
Created June 12, 2022 13:22
This is a simple PHP Mysql and Phpmyadmin docker stack setup guide file.

Php-Mysql-Phpmyadmin

First: Database.

docker run --name db --network myappfnnet -p 3306:3306 -e MYSQL_DATABASE=mydb -e MYSQL_USER=mydbuser -e MYSQL_PASSWORD=mydbpassword -e MYSQL_ROOT_PASSWORD=mydbrootpassword -v /home/myuser/volumes/mysql:/var/lib/mysql -d mysql 

Second: Phpmyadmin.

@AlperRehaYAZGAN
AlperRehaYAZGAN / Dockerfile
Created June 2, 2022 16:50
Simple multistage golang executable only build Dockerfile
# first stage
FROM golang:1.17-alpine3.15 AS build-env
RUN apk add build-base
ADD . /src
RUN cd /src && go build -o goapp
# second stage
FROM alpine
# simple docker-compose.yml file for nats, redis, postgres and minio
version: '3'
services:
# nats service
natsapp:
image: nats:2.6.6-alpine3.14
networks:
- alyafnnet
ports:
- "4222:4222"
// npm install express knex sqlite3 validatorjs
// npm install @vscode/sqlite3
const express = require('express');
const app = express();
// validatorjs
const Validator = require('validatorjs');
// knex
const knex = require('knex')({
client: 'sqlite3',
@AlperRehaYAZGAN
AlperRehaYAZGAN / rocketchat-docker-compose.yaml
Created April 11, 2022 09:20
A simple docker-compose.yaml file for create on-prem Rocketchat server.
version: '2'
services:
rocketchat:
image: registry.rocket.chat/rocketchat/rocket.chat:latest
command: >
bash -c
"for i in `seq 1 30`; do
node main.js &&
s=$$? && break || s=$$?;