Skip to content

chore: add Dockerfile for docker builds #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
./node_modules

Dockerfile

.dockerignore
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Install the app dependencies in a full UBI Node docker image
FROM registry.access.redhat.com/ubi8/nodejs-20:latest

# Copy package.json
COPY package*.json ./
COPY ./ ./

USER 0

# Install npm packages
RUN npm install

ENV NODE_ENV production
EXPOSE 8080

CMD ["npm", "start"]
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"tracing.js",
"public",
"bin",
"LICENSE"
"LICENSE",
"Dockerfile",
".dockerignore"
],
"bugs": {
"url": "https://github.com/nodeshift-starters/nodejs-rest-http/issues"
Expand Down