Skip to content

Commit 1b062dc

Browse files
authored
chore: add Dockerfile for docker builds (#229)
1 parent 11fcd9e commit 1b062dc

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
./node_modules
2+
3+
Dockerfile
4+
5+
.dockerignore

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Install the app dependencies in a full UBI Node docker image
2+
FROM registry.access.redhat.com/ubi8/nodejs-20:latest
3+
4+
# Copy package.json
5+
COPY package*.json ./
6+
COPY ./ ./
7+
8+
USER 0
9+
10+
# Install npm packages
11+
RUN npm install
12+
13+
ENV NODE_ENV production
14+
EXPOSE 8080
15+
16+
CMD ["npm", "start"]

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"tracing.js",
3030
"public",
3131
"bin",
32-
"LICENSE"
32+
"LICENSE",
33+
"Dockerfile",
34+
".dockerignore"
3335
],
3436
"bugs": {
3537
"url": "https://github.com/nodeshift-starters/nodejs-rest-http/issues"

0 commit comments

Comments
 (0)