-
Notifications
You must be signed in to change notification settings - Fork 0
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
51a8ae3
commit 7d66a66
Showing
2 changed files
with
14 additions
and
8 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,18 +1,24 @@ | ||
FROM node:22-slim | ||
RUN apt update \ | ||
&& apt --no-install-recommends install -y curl \ | ||
&& apt clean | ||
# Our first stage, that is the Builder | ||
FROM node:22-slim AS thumbnail-api-builder | ||
WORKDIR /opt/thumbnail-api | ||
COPY src /opt/thumbnail-api/src | ||
COPY package.json /opt/thumbnail-api | ||
COPY package-lock.json /opt/thumbnail-api | ||
COPY tsconfig.json /opt/thumbnail-api | ||
COPY eslint.config.mjs /opt/thumbnail-api | ||
RUN npm install --ignore-scripts && npm run clean && npm run build | ||
|
||
FROM node:22-slim AS thumbnail-api-prod | ||
RUN apt update \ | ||
&& apt --no-install-recommends install -y curl \ | ||
&& apt clean | ||
WORKDIR /opt/thumbnail-api | ||
COPY package.json . | ||
COPY package-lock.json . | ||
COPY --from=thumbnail-api-builder /opt/thumbnail-api/dist /opt/thumbnail-api/dist | ||
RUN chown -R node:node /opt/thumbnail-api | ||
USER node | ||
EXPOSE 3000 | ||
HEALTHCHECK CMD ["curl", "-f", "http://localhost:3000/health"] | ||
RUN npm run clean \ | ||
&& npm ci --ignore-scripts \ | ||
&& npm run build | ||
RUN npm install --omit=dev --omit=optional --ignore-scripts | ||
CMD ["npm", "run", "start", "-s"] |
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