2020-05-21 02:11:19 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Colors
|
|
|
|
BLUE='\E[1;34m'
|
|
|
|
CYAN='\E[1;36m'
|
|
|
|
GREEN='\E[1;32m'
|
|
|
|
RED='\E[1;31m'
|
|
|
|
RESET='\E[0m'
|
|
|
|
YELLOW='\E[1;33m'
|
|
|
|
|
|
|
|
export BLUE CYAN GREEN RED RESET YELLOW
|
|
|
|
|
|
|
|
# Docker Compose
|
2024-12-23 17:57:54 -05:00
|
|
|
COMPOSE_PROJECT_NAME="npm2dev"
|
2020-05-21 02:11:19 -04:00
|
|
|
COMPOSE_FILE="docker/docker-compose.dev.yml"
|
|
|
|
|
|
|
|
export COMPOSE_FILE COMPOSE_PROJECT_NAME
|
2024-10-15 21:06:29 -04:00
|
|
|
|
|
|
|
# $1: container_name
|
|
|
|
get_container_ip () {
|
|
|
|
local container_name=$1
|
|
|
|
local container
|
|
|
|
local ip
|
|
|
|
container=$(docker-compose ps --all -q "${container_name}" | tail -n1)
|
|
|
|
ip=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container")
|
|
|
|
echo "$ip"
|
|
|
|
}
|