-
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
064b736
commit 9731c3a
Showing
1 changed file
with
10 additions
and
13 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,19 +1,16 @@ | ||
FROM node:20 | ||
FROM node:20-alpine | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
RUN corepack enable | ||
WORKDIR /app | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
COPY ./package*.json ./ | ||
|
||
RUN npm install | ||
# If you are building your code for production | ||
# RUN npm ci --omit=dev | ||
RUN --mount=id=npm,type=cache,target=/root/.npm,sharing=locked \ | ||
npm install --omit=dev | ||
|
||
# Bundle app source | ||
COPY . . | ||
COPY ./.env index.js ./ | ||
COPY ./views/ ./views/ | ||
|
||
EXPOSE 3000 | ||
USER node | ||
EXPOSE 3000/tcp | ||
CMD [ "npm", "start" ] |