Skip to content

Commit

Permalink
Update Samples to be concise (#643)
Browse files Browse the repository at this point in the history
Signed-off-by: Maysun J Faisal <[email protected]>
  • Loading branch information
maysunfaisal authored Oct 12, 2021
1 parent ad5ff4c commit adf74d8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample
schemaVersion: 2.1.0
schemaVersion: 2.2.0
metadata:
name: nodejs
version: 1.0.1
Expand All @@ -17,7 +17,7 @@ components:
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
uri: ./Dockerfile
uri: ./utils/Dockerfile
buildContext: /project
rootRequired: false
- name: outerloop-deploy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample
schemaVersion: 2.1.0
schemaVersion: 2.2.0
metadata:
name: nodejs
version: 1.0.1
Expand All @@ -13,12 +13,12 @@ components:
image:
imageName: node-image:latest
dockerfile:
uri: ./Dockerfile
uri: ./utils/Dockerfile
buildContext: /project
rootRequired: false
- name: outerloop-deploy
kubernetes:
uri: deployment-manifest.yaml
uri: ./utils/deployment-manifest.yaml
- name: runtime
container:
image: registry.access.redhat.com/ubi8/nodejs-14:latest
Expand Down
22 changes: 22 additions & 0 deletions samples/devfiles/utils/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Sample copied from https://github.com/nodeshift-starters/devfile-sample/blob/main/Dockerfile

# Install the app dependencies in a full Node docker image
FROM registry.access.redhat.com/ubi8/nodejs-14:latest

# Copy package.json and package-lock.json
COPY package*.json ./

# Install app dependencies
RUN npm install --production

# Copy the dependencies into a Slim Node docker image
FROM registry.access.redhat.com/ubi8/nodejs-14-minimal:latest

# Install app dependencies
COPY --from=0 /opt/app-root/src/node_modules /opt/app-root/src/node_modules
COPY . /opt/app-root/src

ENV NODE_ENV production
ENV PORT 3001

CMD ["npm", "start"]
File renamed without changes.

0 comments on commit adf74d8

Please sign in to comment.