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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
# rabbitmq service | |
rabbitmqapp: | |
image: rabbitmq:3.10.0-rc.1-management-alpine | |
networks: | |
- alyafnnet | |
ports: | |
- "5672:5672" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
redis: | |
image: redis:7.0.4-alpine | |
networks: | |
- alyafnnet | |
volumes: | |
- ./volumes/redis:/data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker volume create gitlab-runner-config | |
version: "3.5" | |
services: | |
dind: | |
image: docker:20-dind | |
restart: always | |
privileged: true | |
environment: | |
DOCKER_TLS_CERTDIR: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=$$?; |