-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18cab09
commit 27d5988
Showing
1 changed file
with
6 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
FROM ubuntu:22.04 | ||
FROM node:20 AS build-env | ||
WORKDIR /app | ||
|
||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get --no-install-recommends -y install nodejs npm curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& nodejs -v \ | ||
&& npm -v | ||
WORKDIR /usr/src/app | ||
COPY package.json . | ||
COPY package-lock.json . | ||
RUN npm ci | ||
COPY db db/ | ||
COPY srv srv/ | ||
COPY srv/gen/srv/csn.json srv/ | ||
#COPY srv/gen/srv/csn.json srv/ | ||
COPY app app/ | ||
|
||
FROM gcr.io/distroless/nodejs20-debian12 | ||
COPY --from=build-env /app /app | ||
WORKDIR /app | ||
EXPOSE 4004 | ||
HEALTHCHECK --interval=5m --timeout=3s \ | ||
CMD curl -f http://localhost:4004/ || exit 1 | ||
RUN groupadd --gid 1000 node \ | ||
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node | ||
USER node | ||
CMD [ "npm", "start" ] |