-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup docker build with download npm from the registry + CI workflow
- Loading branch information
Showing
7 changed files
with
71 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Frontend & Docker CI Workflow | ||
|
||
on: | ||
release: | ||
types: [created] | ||
push: | ||
branches: | ||
- main | ||
- release | ||
- develop | ||
- feature/* | ||
delete: | ||
branches: | ||
- release | ||
- feature/* | ||
|
||
jobs: | ||
call-frontend-ci-workflow: | ||
uses: netcracker/qubership-apihub-ci/.github/workflows/frontend-ci.yaml@main | ||
call-docker-ci-workflow: | ||
needs: call-frontend-ci-workflow | ||
uses: netcracker/qubership-apihub-ci/.github/workflows/docker-ci.yml@main | ||
with: | ||
name: qubership-apihub-build-task-consumer | ||
file: Dockerfile | ||
context: "" | ||
platforms: linux/amd64,linux/arm64 | ||
labels: | | ||
maintainer=qubership | ||
qubership-apihub-build-task-consumer-package-version=${{ needs.jobs.call-frontend-ci-workflow.outputs.package_version }} | ||
secrets: | ||
NPMRC: ${{ secrets.NPMRC }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
FROM node:20 | ||
FROM docker.io/node:20 | ||
|
||
ARG TAG=dev | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ADD .npmrc .npmrc | ||
COPY package*.json ./ | ||
RUN npm ci | ||
RUN apt-get update && apt-get install -y jq && rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
ADD dist dist | ||
RUN --mount=type=secret,id=npmrc,target=.npmrc mv $(npm pack @netcracker/qubership-apihub-build-task-consumer@"$TAG") qubership-apihub-build-task-consumer.tgz | ||
RUN tar zxvf ./qubership-apihub-build-task-consumer.tgz && mv ./package/dist dist | ||
RUN --mount=type=secret,id=npmrc,target=.npmrc mv ./package/package.json package.json && npm install --production | ||
|
||
USER 10001 | ||
|
||
CMD [ "node", "--max-old-space-size=3100", "--max-semi-space-size=32", "dist/main" ] | ||
CMD [ "node", "--max-old-space-size=3100", "--max-semi-space-size=32", "dist/main" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM docker.io/node:20 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ADD .npmrc .npmrc | ||
COPY package*.json ./ | ||
RUN npm ci | ||
ADD dist dist | ||
|
||
USER 10001 | ||
|
||
CMD [ "node", "--max-old-space-size=3100", "--max-semi-space-size=32", "dist/main" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters