diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..919537b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +./node_modules + +Dockerfile + +.dockerignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8003ee2 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/package.json b/package.json index 73b94d4..0a3e54c 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ "tracing.js", "public", "bin", - "LICENSE" + "LICENSE", + "Dockerfile", + ".dockerignore" ], "bugs": { "url": "https://github.com/nodeshift-starters/nodejs-rest-http/issues"