Skip to content

Commit e22fdeb

Browse files
authored
Merge pull request #232 from DefangLabs/linda-vue-baseimage
bookworm-slim for vuejs
2 parents cccc118 + 37bace6 commit e22fdeb

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

samples/vuejs/app/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
# Use Node runtime as base image
2-
FROM node:20-alpine
1+
# Use slim version of Node.js v20 on Debian Bookworm as base image
2+
FROM node:20-bookworm-slim
3+
4+
# Install curl for healthchecks testing
5+
RUN apt-get update -qq \
6+
&& apt-get install -y curl \
7+
&& apt-get clean \
8+
&& rm -rf /var/lib/apt/lists/*
39

410
# Set working directory to /app
511
WORKDIR /app
@@ -8,7 +14,7 @@ WORKDIR /app
814
COPY package*.json ./
915

1016
# Install dependencies
11-
RUN npm install
17+
RUN npm ci
1218

1319
# Copy the rest of your application's code
1420
COPY . .
@@ -17,4 +23,4 @@ COPY . .
1723
EXPOSE 5173
1824

1925
# Command to run the app when container is finished launch
20-
CMD ["npm", "run", "dev"]
26+
CMD ["npm", "run", "dev"]

samples/vuejs/compose.dev.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
app:
3+
extends:
4+
file: compose.yaml
5+
service: app
6+
ports:
7+
- "5174:5173"
8+
volumes:
9+
- ./app:/app
10+
- /app/node_modules
11+
command: npm run dev

samples/vuejs/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ services:
1313
reservations:
1414
memory: 512M
1515
healthcheck:
16-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:5173/"]
16+
test: ["CMD", "curl", "-f", "http://localhost:5173/"]

0 commit comments

Comments
 (0)