Localhost only exposed ports and stronger password for Postgres local environment instance
19 lines
378 B
Bash
Executable File
19 lines
378 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -x
|
|
set -eo pipefail
|
|
|
|
RUNNING_CONTAINER=$(docker ps --filter 'name=redis' --format '{{.ID}}')
|
|
if [[ -n $RUNNING_CONTAINER ]]; then
|
|
echo >&2 "A redis container is already running (${RUNNING_CONTAINER})."
|
|
exit 1
|
|
fi
|
|
|
|
docker run \
|
|
-p "127.0.0.1:6379:6379" \
|
|
-d \
|
|
--name "redis_$(date '+%s')" \
|
|
redis
|
|
|
|
>&2 echo "Redis is ready to go!"
|