Skip to content

Commit adf74d8

Browse files
authored
Update Samples to be concise (#643)
Signed-off-by: Maysun J Faisal <[email protected]>
1 parent ad5ff4c commit adf74d8

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

samples/devfiles/outerloop-dockerfile-build-inlined-deploy-devfile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample
2-
schemaVersion: 2.1.0
2+
schemaVersion: 2.2.0
33
metadata:
44
name: nodejs
55
version: 1.0.1
@@ -17,7 +17,7 @@ components:
1717
image:
1818
imageName: "{{CONTAINER_IMAGE}}"
1919
dockerfile:
20-
uri: ./Dockerfile
20+
uri: ./utils/Dockerfile
2121
buildContext: /project
2222
rootRequired: false
2323
- name: outerloop-deploy

samples/devfiles/outerloop-dockerfile-build-uri-deploy-devfile.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Devfile based on the existing Node Sample https://github.com/nodeshift-starters/devfile-sample
2-
schemaVersion: 2.1.0
2+
schemaVersion: 2.2.0
33
metadata:
44
name: nodejs
55
version: 1.0.1
@@ -13,12 +13,12 @@ components:
1313
image:
1414
imageName: node-image:latest
1515
dockerfile:
16-
uri: ./Dockerfile
16+
uri: ./utils/Dockerfile
1717
buildContext: /project
1818
rootRequired: false
1919
- name: outerloop-deploy
2020
kubernetes:
21-
uri: deployment-manifest.yaml
21+
uri: ./utils/deployment-manifest.yaml
2222
- name: runtime
2323
container:
2424
image: registry.access.redhat.com/ubi8/nodejs-14:latest

samples/devfiles/utils/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Sample copied from https://github.com/nodeshift-starters/devfile-sample/blob/main/Dockerfile
2+
3+
# Install the app dependencies in a full Node docker image
4+
FROM registry.access.redhat.com/ubi8/nodejs-14:latest
5+
6+
# Copy package.json and package-lock.json
7+
COPY package*.json ./
8+
9+
# Install app dependencies
10+
RUN npm install --production
11+
12+
# Copy the dependencies into a Slim Node docker image
13+
FROM registry.access.redhat.com/ubi8/nodejs-14-minimal:latest
14+
15+
# Install app dependencies
16+
COPY --from=0 /opt/app-root/src/node_modules /opt/app-root/src/node_modules
17+
COPY . /opt/app-root/src
18+
19+
ENV NODE_ENV production
20+
ENV PORT 3001
21+
22+
CMD ["npm", "start"]
File renamed without changes.

0 commit comments

Comments
 (0)