Skip to content

Commit 4bf2ef3

Browse files
committed
fix: update CI/CD workflow to use fixed Node.js version and improve Dockerfile structure
feat: add health check button to index.html for server status verification
1 parent 4885c21 commit 4bf2ef3

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ jobs:
2323
--health-timeout 5s
2424
--health-retries 5
2525
26-
strategy:
27-
matrix:
28-
node-version: [22.x, 24.x]
26+
# Uncomment the following lines to run tests on multiple Node.js versions
27+
# strategy:
28+
# matrix:
29+
# node-version: [22.x, 24.x]
2930

3031
steps:
3132
- name: Checkout code to runner
@@ -34,7 +35,7 @@ jobs:
3435
- name: Set up Node.js
3536
uses: actions/setup-node@v2
3637
with:
37-
node-version: "${{ matrix.node-version }}"
38+
node-version: "22"
3839

3940
- name: Install dependencies
4041
run: npm install

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ WORKDIR /app
55

66
# Set environment variables for the application
77
ENV PORT=80
8+
ENV NODE_ENV=production
89

910
# Copy package.json and Prisma schema files to the container
1011
COPY package*.json ./
11-
COPY prisma ./
12+
COPY prisma ./prisma/
1213

13-
RUN npm install
14+
# Install dependencies and generate Prisma client
15+
RUN npm ci --only=production && npx prisma generate
1416

1517
# Copy the rest of the application code
1618
COPY . .
1719

18-
# Validate the Prisma schema and generate the Prisma client
19-
RUN npx prisma generate
20-
2120
# Expose the application port
2221
EXPOSE 80
2322

docs/diagrams/diagram.png

-17.9 KB
Loading

public/static/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ <h2>Welcome to the Express Server</h2>
6363
<p><span class="bold">DELETE</span> /api/users/:id - Delete a specific user by ID.</p>
6464
<p><span class="bold">GET</span> /health - Check the health status of the server.</p>
6565
</div>
66+
<p style="width: 600px;font-size: 13px;padding-top: 20px;">
67+
Click the button below to check the health of the server. It will redirect you to the /health endpoint where
68+
you can see the server status and latest update information.
69+
</p>
6670
<button onclick="window.location.href='/health'"
6771
style="background-color: #212121;color: #ffff; outline: none; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; margin-top: 20px;">
6872
Check server health

0 commit comments

Comments
 (0)