Skip to content

Commit 5b12208

Browse files
authored
Merge pull request #1 from clelange/main
Make work on Openshift 4
2 parents 015406a + 3a4f68b commit 5b12208

File tree

3 files changed

+68
-7
lines changed

3 files changed

+68
-7
lines changed

Diff for: .github/workflows/docker.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Create and publish a Docker image
7+
8+
on:
9+
push:
10+
branches:
11+
- 'main'
12+
tags:
13+
- 'v*'
14+
pull_request:
15+
branches:
16+
- 'main'
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
IMAGE_NAME: ${{ github.repository }}
21+
22+
jobs:
23+
build-and-push-image:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
packages: write
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
33+
- name: Log in to the Container registry
34+
if: github.event_name != 'pull_request'
35+
uses: docker/login-action@v2
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract metadata (tags, labels) for Docker
42+
id: meta
43+
uses: docker/metadata-action@v4
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@v3
49+
with:
50+
context: .
51+
push: ${{ github.event_name != 'pull_request' }}
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}

Diff for: Dockerfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
FROM node:alpine
1+
FROM registry.access.redhat.com/ubi8/nodejs-14
22

3-
WORKDIR /usr/src/app
4-
5-
COPY package* ./
3+
USER 0
4+
RUN mkdir -p /usr/src/app && \
5+
chown -R 1001:0 /usr/src/app
66

7+
USER 1001
8+
WORKDIR /usr/src/app
9+
ADD package* ./
710
RUN npm ci
8-
9-
COPY . .
10-
11+
ADD . .
1112
CMD ["npm", "start"]

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ The server application can be deployed with the workflow in `.github/workflows/m
5656

5757
Opens in the URL indicated in the Google Cloud platform dashboard under "Services".
5858

59+
### Import in Openshift
60+
61+
Import the docker image as image stream:
62+
63+
```
64+
oc tag ghcr.io/katilp/node-json-api:main cms-info-server:latest --scheduled
65+
```

0 commit comments

Comments
 (0)