Skip to content

Instantly share code, notes, and snippets.

View emilioSp's full-sized avatar
🐴

Emilio Spatola emilioSp

🐴
View GitHub Profile
@emilioSp
emilioSp / Mail catcher
Last active May 6, 2020 09:26
Mail catcher
docker run --rm --detach -p 1025:1025 -p 1080:1080 --name mailcatcher schickling/mailcatcher
ui: http://localhost:1080/
SMTP='{"host": "host.docker.internal","port": 1025,"secure": false,"connectionTimeout": 10000,"tls": {"rejectUnauthorized": false}}'
@emilioSp
emilioSp / Run if not running
Created May 6, 2020 11:00
Start container only if it is not already running
docker ps --format '{{.Names}}' | egrep '^container_name$' || docker run --rm --detach --name container_name org/container_name
@emilioSp
emilioSp / gist:adc088ac7bdcae9dea1ae18e45ddf3c8
Created November 15, 2022 10:30
Wait docker container for being healthy
#!/usr/bin/env bash
container_name=$1
shift
timeout=$1
default_timeout=120
if [ -z ${timeout} ]; then
timeout=${default_timeout}
fi