Skip to content

Commit e687d8b

Browse files
committed
Enhance Dockerfile and deploy script with cache busting and logging improvements
1 parent 6af62bc commit e687d8b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

api/oracle-cloud/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ FROM node:20
22
# Create app directory
33
WORKDIR /usr/src/repo
44

5-
# copy app bundle
5+
# must run with: docker compose build --build-arg CACHEBUST=$(date +%s)
6+
ARG CACHEBUST=1
7+
8+
# This COPY step will never use cache because of the ARG reference above
69
COPY . ./
710

811
RUN pwd

api/oracle-cloud/deploy.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ console.log(String(logs));
6565

6666
console.log("⚠️ Deleting old code ...");
6767
logs = execSync(sshPrefix + '"rm -f -r ' + appPath + '"');
68+
console.log(String(logs));
6869
logs = execSync(sshPrefix + '"mkdir ' + appPath + '"');
70+
console.log(String(logs));
6971

7072
console.log("⤴️ Uploading new code ...");
7173
logs = execSync(
@@ -76,7 +78,13 @@ logs = execSync(
7678
":" +
7779
appPath,
7880
);
79-
console.log("✅ New code uploaded.");
81+
console.log(String(logs));
82+
83+
console.log("⚙️ Rebuilding docker images ...");
84+
logs = execSync(
85+
sshPrefix + '"cd ' + appPath + ' && docker compose build --build-arg CACHEBUST=$(date +%s)"',
86+
);
87+
console.log(String(logs));
8088

8189
console.log("\n⚙️ Starting up the app");
8290
logs = execSync(

0 commit comments

Comments
 (0)