57 lines
1.2 KiB
Batchfile
57 lines
1.2 KiB
Batchfile
```bat
|
|
@echo off
|
|
setlocal
|
|
|
|
rem Define your services here
|
|
set SERVICES=
|
|
|
|
rem Define the environment file
|
|
set ENV_FILE=.env
|
|
|
|
rem Load the environment variables
|
|
if exist "%ENV_FILE%" (
|
|
for /f "usebackq tokens=*" %%i in ("%ENV_FILE%") do (
|
|
set "%%i"
|
|
)
|
|
)
|
|
|
|
rem Define the default action
|
|
set ACTION=up
|
|
|
|
rem Parse command line arguments
|
|
:parse_args
|
|
if "%~1"=="" goto :end_parse
|
|
if "%~1"=="--build" (
|
|
set ACTION=build
|
|
) else if "%~1"=="--down" (
|
|
set ACTION=down
|
|
) else if "%~1"=="--help" (
|
|
goto :help
|
|
) else if "%~1"=="dev:watch" (
|
|
goto :dev_watch
|
|
)
|
|
shift
|
|
goto :parse_args
|
|
|
|
:end_parse
|
|
|
|
rem Display help
|
|
:help
|
|
echo Usage: docker-compose-wrapper [options]
|
|
echo.
|
|
echo Options:
|
|
echo --build Build the services
|
|
echo --down Stop and remove the containers
|
|
echo --help Display this help message
|
|
echo dev:watch Start development environment with file watchers
|
|
goto :eof
|
|
|
|
rem Development watch mode
|
|
:dev_watch
|
|
echo Starting development environment with file watchers...
|
|
docker-compose -f docker-compose.watch.yml up --build
|
|
goto :eof
|
|
|
|
rem Execute the docker-compose command with the parsed action
|
|
%DOCKER_COMPOSE% %ACTION% %SERVICES%
|
|
``` |