Skip to content

Commit 6c8c88b

Browse files
committed
feat: upgrade dockerfile and replace deprecated node14
1 parent 223cb4f commit 6c8c88b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

api.Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
# Stage 1: Build the Vue.js application
2-
FROM node:14 AS build-stage
2+
FROM node:22 AS build-stage
33

44
USER node
55
WORKDIR /app
66

77
COPY --chown=1000:1000 package*.json ./
88
RUN npm install
99
COPY --chown=1000:1000 . .
10-
# this will tokenize the app
1110
RUN npm run build
1211

1312
# Stage 2: Prepare the Node.js API
14-
FROM node:14 AS api-stage
13+
FROM node:22 AS api-stage
14+
1515
WORKDIR /api
16+
1617
# Copy package.json and other necessary files for the API
1718
COPY --chown=1000:1000 api/package*.json ./
18-
RUN npm install \
19-
&& chown -R 1000:1000 /api
19+
RUN npm install && \
20+
chown -R 1000:1000 /api && \
21+
apt-get update && \
22+
apt-get install -y --no-install-recommends gettext-base && \
23+
apt-get clean && \
24+
rm -rf /var/lib/apt/lists/*
2025

2126
# Copy the rest of your API source code
2227
COPY --chown=1000:1000 api/ .
@@ -25,14 +30,11 @@ COPY --chown=1000:1000 api/ .
2530
COPY --chown=1000:1000 --from=build-stage /app/dist /api/public
2631
COPY --chown=1000:1000 --from=build-stage /app/dist/assets/app-config.js /api/app-config.template.js
2732

28-
# install gettext-base for envsubst
29-
RUN apt-get update && apt-get install -y gettext-base
30-
3133
# Expose the port your API will run on
3234
EXPOSE 3000
3335

3436
# Command to run your API (and serve your Vue.js app)
3537
RUN chmod +x /api/docker-entrypoint.api/entrypoint.sh
3638

3739
USER node
38-
ENTRYPOINT ["/api/docker-entrypoint.api/entrypoint.sh"]
40+
ENTRYPOINT ["/api/docker-entrypoint.api/entrypoint.sh"]

0 commit comments

Comments
 (0)