docker compose not docker-compose

This commit is contained in:
Jamie Curnow committed 2026-09-28 11:37:31 +10:00
1 parent 796920ed13
commit 853ef909a7
9 files changed
+83 -117

No files matched your search

+4 -9
View File
@@ -3,12 +3,7 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
# Ensure docker-compose exists
# Make sure docker exists
if hash docker-compose 2>/dev/null; then
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Destroying Dev Stack ...${RESET}"
docker-compose down --remove-orphans --volumes
else
echo -e "${RED}❯ docker-compose command is not available${RESET}"
fi
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Destroying Dev Stack ...${RESET}"
docker compose down --remove-orphans --volumes
+5 -9
View File
@@ -3,12 +3,8 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
# Ensure docker-compose exists
if hash docker 2>/dev/null; then
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Building Docs ...${RESET}"
docker run --rm -e CI=true -v "$(pwd)/docs:/app/docs" -w /app/docs node:latest sh -c "yarn install && yarn build && chown -R $(id -u):$(id -g) /app/docs"
echo -e "${BLUE}❯ ${GREEN}Building Docs Complete${RESET}"
else
echo -e "${RED}❯ docker command is not available${RESET}"
fi
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Building Docs ...${RESET}"
docker run --rm -e CI=true -v "$(pwd)/docs:/app/docs" -w /app/docs node:latest sh -c "yarn install && yarn build && chown -R $(id -u):$(id -g) /app/docs"
echo -e "${BLUE}❯ ${GREEN}Building Docs Complete${RESET}"
+7 -12
View File
@@ -3,15 +3,10 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
# Ensure docker-compose exists
if hash docker 2>/dev/null; then
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Linting Frontend ...${RESET}"
docker run --rm -e CI=true -v "$(pwd)/frontend:/app/frontend" -w /app/frontend node:lts sh -c "yarn install && yarn eslint src;chown -R $(id -u):$(id -g) /app/frontend"
RES=$?
echo -e "${BLUE}❯ ${GREEN}Linting Frontend Complete${RESET}"
exit $RES
else
echo -e "${RED}❯ docker command is not available${RESET}"
exit 1
fi
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Linting Frontend ...${RESET}"
docker run --rm -e CI=true -v "$(pwd)/frontend:/app/frontend" -w /app/frontend node:lts sh -c "yarn install && yarn eslint src;chown -R $(id -u):$(id -g) /app/frontend"
RES=$?
echo -e "${BLUE}❯ ${GREEN}Linting Frontend Complete${RESET}"
exit $RES
+6 -10
View File
@@ -3,15 +3,11 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
# Ensure docker-compose exists
if hash docker-compose 2>/dev/null; then
cd "${DIR}/.."
cd "${DIR}/.."
echo ""
inform "Tip: List tables with: \\dt"
echo ""
echo ""
inform "Tip: List tables with: \\dt"
echo ""
docker compose exec npm usql /data/nginxproxymanager.db
docker-compose exec npm usql /data/nginxproxymanager.db
else
echo -e "${RED}❯ docker-compose command is not available${RESET}"
fi
+30 -34
View File
@@ -8,49 +8,45 @@ get_container_ip () {
local container_name=$1
local container
local ip
container=$(docker-compose ps --all -q "${container_name}" | tail -n1)
container=$(docker compose ps --all -q "${container_name}" | tail -n1)
ip=$(docker inspect -f "{{.NetworkSettings.Networks.npmdev_default.IPAddress}}" "$container")
echo "$ip"
}
# Ensure docker-compose exists
if hash docker-compose 2>/dev/null; then
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Starting Dev Stack ...${RESET}"
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Starting Dev Stack ...${RESET}"
# Bring up a stack, in steps so we can inject IPs everywhere
docker-compose up -d npm-pdns npm-pdns-db
PDNS_IP=$(get_container_ip 'npm-pdns')
echo -e "${BLUE}❯ ${YELLOW}PDNS IP is ${PDNS_IP}${RESET}"
# Bring up a stack, in steps so we can inject IPs everywhere
docker compose up -d npm-pdns npm-pdns-db
PDNS_IP=$(get_container_ip 'npm-pdns')
echo -e "${BLUE}❯ ${YELLOW}PDNS IP is ${PDNS_IP}${RESET}"
# adjust the dnsrouter config
LOCAL_DNSROUTER_CONFIG="$DIR/../docker/dev/dnsrouter-config.json"
rm -rf "$LOCAL_DNSROUTER_CONFIG.tmp"
# IMPORTANT: changes to dnsrouter-config.json will affect this line:
jq --arg a "$PDNS_IP" '.servers[0].upstreams[1].upstream = $a' "$LOCAL_DNSROUTER_CONFIG" > "$LOCAL_DNSROUTER_CONFIG.tmp"
# adjust the dnsrouter config
LOCAL_DNSROUTER_CONFIG="$DIR/../docker/dev/dnsrouter-config.json"
rm -rf "$LOCAL_DNSROUTER_CONFIG.tmp"
# IMPORTANT: changes to dnsrouter-config.json will affect this line:
jq --arg a "$PDNS_IP" '.servers[0].upstreams[1].upstream = $a' "$LOCAL_DNSROUTER_CONFIG" > "$LOCAL_DNSROUTER_CONFIG.tmp"
# dnsrouter
docker-compose up -d npm-dnsrouter
DNSROUTER_IP=$(get_container_ip 'npm-dnsrouter')
echo -e "${BLUE}❯ ${YELLOW}DNS Router IP is ${DNSROUTER_IP}${RESET}"
# dnsrouter
docker compose up -d npm-dnsrouter
DNSROUTER_IP=$(get_container_ip 'npm-dnsrouter')
echo -e "${BLUE}❯ ${YELLOW}DNS Router IP is ${DNSROUTER_IP}${RESET}"
# mount the resolver
LOCAL_RESOLVE="$DIR/../docker/dev/resolv.conf"
rm -rf "${LOCAL_RESOLVE}"
printf "nameserver %s\noptions ndots:0" "${DNSROUTER_IP}" > "${LOCAL_RESOLVE}"
# mount the resolver
LOCAL_RESOLVE="$DIR/../docker/dev/resolv.conf"
rm -rf "${LOCAL_RESOLVE}"
printf "nameserver %s\noptions ndots:0" "${DNSROUTER_IP}" > "${LOCAL_RESOLVE}"
# bring things up, but only what we haven't already created
docker-compose up -d --remove-orphans --force-recreate --build npm npm-pebble npm-stepca npm-swagger
# bring things up, but only what we haven't already created
docker compose up -d --remove-orphans --force-recreate --build npm npm-pebble npm-stepca npm-swagger
if [ "$1" == "-f" ]; then
echo -e "${BLUE}❯ ${YELLOW}Following Backend Container:${RESET}"
docker logs -f npm.dev
else
echo -e "${YELLOW}Tip:${RESET} You can follow the output of some of the containers with:"
echo " docker logs -f npm.dev"
echo -e "${YELLOW}Tip:${RESET} Open a database terminal with:"
echo " ./scripts/sqlite"
fi
if [ "$1" == "-f" ]; then
echo -e "${BLUE}❯ ${YELLOW}Following Backend Container:${RESET}"
docker logs -f npm.dev
else
echo -e "${RED}❯ docker-compose command is not available${RESET}"
echo -e "${YELLOW}Tip:${RESET} You can follow the output of some of the containers with:"
echo " docker logs -f npm.dev"
echo -e "${YELLOW}Tip:${RESET} Open a database terminal with:"
echo " ./scripts/sqlite"
fi
+4 -9
View File
@@ -3,12 +3,7 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
# Ensure docker-compose exists
# Make sure docker exists
if hash docker-compose 2>/dev/null; then
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Stopping Dev Stack ...${RESET}"
docker-compose down --remove-orphans
else
echo -e "${RED}❯ docker-compose command is not available${RESET}"
fi
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Stopping Dev Stack ...${RESET}"
docker compose down --remove-orphans
+4 -8
View File
@@ -3,11 +3,7 @@
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
# Ensure docker-compose exists
if hash docker-compose 2>/dev/null; then
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Testing Dev Stack ...${RESET}"
docker-compose exec -T npm bash -c "cd /app/backend && task test"
else
echo -e "${RED}❯ docker-compose command is not available${RESET}"
fi
cd "${DIR}/.."
echo -e "${BLUE}❯ ${CYAN}Testing Dev Stack ...${RESET}"
docker compose exec -T npm bash -c "cd /app/backend && task test"