Something went wrong. Try again.
NixOS + home-manager configs, mirrored from GitLab SaaS. gitlab.com/andreijiroh-dev/nixops-config
nix-flake nixos home-manager nixpkgs nix-flakes
Something went wrong. Try again.
2.0 kB · 51 lines
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#!/usr/bin/env bash# SPDX-License-Identifier: MPL-2.0# Wrapper script for managing Coolify Docker Compose setup without needing# to copy-paste --env-file and --file flags from the Coolify docs.
COOLIFY_DIR=${COOLIFY_DIR:-"/data/coolify"}COOLIFY_SOURCE_DIR="${COOLIFY_DIR}/source"SUDO=${SUDO:-"sudo"}
if [[ $DEBUG != "" ]]; then set -xfi
# The main entrypoint to docker-compose pointing to Coolify's compose + dotenv files,# after handling those compose commands.main() { # Since the /data/coolify folder is chowned to 9999:root, we need to esclate # perms via $SUDO. if [[ $EUID != "0" ]]; then echo "Attempting to exec as root via $(command -v ${SUDO})..." exec "${SUDO}" docker compose --env-file "${COOLIFY_SOURCE_DIR}/.env" \ -f "${COOLIFY_SOURCE_DIR}/docker-compose.yml" \ -f "${COOLIFY_SOURCE_DIR}/docker-compose.prod.yml" \ "$@" else exec docker compose --env-file "${COOLIFY_SOURCE_DIR}/.env" \ -f "${COOLIFY_SOURCE_DIR}/docker-compose.yml" \ -f "${COOLIFY_SOURCE_DIR}/docker-compose.prod.yml" \ "$@" fi}
if [[ $1 == "up" ]]; then # From the Coolify docs for manual installation steps, we always want to use these # flags when bringing up. # Docs: https://coolify.io/docs/get-started/installation#_7-start-coolify main "$@" -d --remove-orphans --pull=always --force-recreateelif [[ $1 == "down" ]]; then # From the Coolify docs for uninstallation steps (the Compose way of tearing down # containers), we always want to use these flags when bringing down. # Docs: https://coolify.io/docs/get-started/uninstallation#_1-stop-and-remove-containers main "$@" --timeout=0elif [[ $1 == "stop" ]]; then # From the Coolify docs for uninstallation steps (the `docker stop` one), we # always want to use these flags when stopping # Docs: https://coolify.io/docs/get-started/uninstallation#_1-stop-and-remove-containers main "$@" --timeout=0else main "$@"fi