fabriquedoc/run_docker_compose.sh

33 lines
873 B
Bash
Raw Permalink Normal View History

2024-12-31 22:00:07 +00:00
#!/bin/bash
# Bash script (for Linux/macOS)
# Check if docker-compose is installed
if ! command -v docker-compose &> /dev/null
then
echo "docker-compose could not be found. Please install it and try again."
exit 1
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo ".env file not found. Please create it and try again."
exit 1
fi
# Check if docker-compose-local.yml file exists
if [ ! -f docker-compose-local.yml ]; then
echo "docker-compose-local.yml file not found. Please create it and try again."
exit 1
fi
2024-12-31 22:00:07 +00:00
# Load environment variables from .env file
set -a
source .env
set +a
2025-01-12 21:36:52 +00:00
# Set a custom project name (which will be used for the network name)
PROJECT_NAME="fabriquedoc"
# Run docker-compose with the custom project name and local configuration
docker-compose -f docker-compose-local.yml --project-name $PROJECT_NAME up --build