Skip to content

Commit 12957f9

Browse files
Updating docker container name & workflow deploymnent.
1 parent 2658432 commit 12957f9

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
fi
6161
else
6262
echo "Database container not found. Creating it..."
63-
# Added -p flag to associate with the correct stack
64-
docker compose -p codebuilder-frontend up -d db
63+
# Use 'codebuilder' as the stack prefix
64+
docker compose -p codebuilder up -d db
6565
fi
6666
6767
# Step 3: Wait for the database to be healthy.
@@ -78,17 +78,17 @@ jobs:
7878
7979
# Step 4: Build the new webapp image.
8080
echo "Building the latest webapp image..."
81-
# Added -p flag to ensure build context is correct
82-
docker compose -p codebuilder-frontend build webapp
81+
# Use 'codebuilder' as the stack prefix
82+
docker compose -p codebuilder build webapp
8383
8484
# Step 5: Forcefully remove the old webapp container to prevent conflicts.
8585
echo "Forcefully removing old webapp container if it exists..."
8686
docker rm -f codebuilder-webapp || true
8787
8888
# Step 6: Deploy the new webapp container.
8989
echo "Deploying the new webapp container..."
90-
# Added -p flag to associate with the correct stack
91-
docker compose -p codebuilder-frontend up -d --no-deps webapp
90+
# Use 'codebuilder' as the stack prefix
91+
docker compose -p codebuilder up -d --no-deps webapp
9292
9393
- name: '🗑 Prune Old Docker Images'
9494
if: always()

docker-compose.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
version: '3.8'
22

33
services:
4+
45
db:
56
image: postgres:13-alpine
6-
container_name: nest-db
7+
container_name: codebuilder-db
78
environment:
89
POSTGRES_USER: ${DB_USER:-nestjs}
910
POSTGRES_PASSWORD: ${DB_PASSWORD:-nestpass}
1011
POSTGRES_DB: ${DB_NAME:-nestdb}
1112
volumes:
12-
- db-data:/var/lib/postgresql/data
13+
- codebuilder-db-data:/var/lib/postgresql/data
1314
networks:
1415
- codebuilder-net
1516

16-
nest-api:
17+
api:
1718
build:
1819
context: .
1920
dockerfile: Dockerfile
20-
container_name: nest-api
21+
container_name: codebuilder-api
2122
environment:
2223
DB_HOST: db
2324
DB_PORT: 5432
@@ -33,8 +34,9 @@ services:
3334
networks:
3435
- codebuilder-net
3536

37+
3638
volumes:
37-
db-data:
39+
codebuilder-db-data:
3840

3941
networks:
4042
codebuilder-net:

0 commit comments

Comments
 (0)