-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprod-deploy.bat
46 lines (35 loc) · 1.08 KB
/
prod-deploy.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@REM deploy-prod.bat
@echo off
setlocal enabledelayedexpansion
:: Store the original directory
set "ORIGINAL_DIR=%CD%"
set "BASE_DIR=%CD%"
set SERVICES=client admin
set PROJECT=rux
echo Starting production deployment process...
:: Create network if it doesn't exist
docker network create %PROJECT%_network 2>nul || echo Network already exists
for %%s in (%SERVICES%) do (
echo.
echo Processing %%s...
if exist "%BASE_DIR%\%%s" (
cd "%BASE_DIR%\%%s"
:: Down the container
echo Stopping %%s containers...
docker compose --env-file .env.prod -f docker-compose.prod.yml down
:: Rebuild
echo Rebuilding %%s...
docker compose --env-file .env.prod -f docker-compose.prod.yml build
:: Start
echo Starting %%s...
set "PROJECT=%PROJECT%" && docker compose --env-file .env.prod -f docker-compose.prod.yml up -d
:: Return to original directory
cd "%ORIGINAL_DIR%"
) else (
echo Directory not found: %BASE_DIR%\%%s
)
)
echo.
echo All services rebuilt and running
docker ps
pause