Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dummy Frontend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Examples
Javascript
Dummy Frontend
Commits
a6f9972f
Unverified
Commit
a6f9972f
authored
1 year ago
by
Дмитрий Сафронов
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
dockerfile (#23)
Signed-off-by:
Dmitriy Safronov
<
zimniy@cyberbrain.pw
>
parent
483286f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/docker-publish.yml
+20
-20
20 additions, 20 deletions
.github/workflows/docker-publish.yml
Dockerfile
+6
-3
6 additions, 3 deletions
Dockerfile
with
26 additions
and
23 deletions
.github/workflows/docker-publish.yml
+
20
−
20
View file @
a6f9972f
...
@@ -99,23 +99,23 @@ jobs:
...
@@ -99,23 +99,23 @@ jobs:
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
#
#
Install the cosign tool except on PR
# Install the cosign tool except on PR
#
#
https://github.com/sigstore/cosign-installer
# https://github.com/sigstore/cosign-installer
#
- name: Install cosign
-
name
:
Install cosign
#
if: github.event_name != 'pull_request'
if
:
${{
github.event_name != 'pull_request'
}}
#
uses: sigstore/cosign-installer@v3
.3.0
uses
:
sigstore/cosign-installer@v3
#
with:
#
with:
#
cosign-release: 'v2.2.2'
#
cosign-release: 'v2.2.2'
#
#
Sign the resulting Docker image digest except on PRs.
# Sign the resulting Docker image digest except on PRs.
#
#
This will only write to the public Rekor transparency log when the Docker
# This will only write to the public Rekor transparency log when the Docker
#
#
repository is public to avoid leaking data. If you would like to publish
# repository is public to avoid leaking data. If you would like to publish
#
#
transparency data even for private images, pass --force to cosign below.
# transparency data even for private images, pass --force to cosign below.
#
#
https://github.com/sigstore/cosign
# https://github.com/sigstore/cosign
#
- name: Sign the published Docker image
-
name
:
Sign the published Docker image
#
if: ${{ github.event_name != 'pull_request' }}
if
:
${{ github.event_name != 'pull_request' }}
#
env:
env
:
#
COSIGN_EXPERIMENTAL: "true"
COSIGN_EXPERIMENTAL
:
"
true"
#
# This step uses the identity token to provision an ephemeral certificate
# This step uses the identity token to provision an ephemeral certificate
#
# against the sigstore community Fulcio instance.
# against the sigstore community Fulcio instance.
#
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
run
:
echo "${{ steps.meta.outputs.tags }}" |
grep -E '^(.+):(.+)-(.+)-(.+)$' |
xargs -I {} cosign sign
--yes
{}@${{ steps.build-and-push.outputs.digest }}
This diff is collapsed.
Click to expand it.
Dockerfile
+
6
−
3
View file @
a6f9972f
# VERSIONS
# VERSIONS
ARG
NODE_VERSION=20.11.1
ARG
NODE_VERSION=20.11.1
ARG
NPM_VERSION=10.4.0
ARG
NGINX_VERSION=1.25.4
ARG
NGINX_VERSION=1.25.4
# --------------> The builder image
# --------------> The builder image
FROM
node:$NODE_VERSION
AS
builder
FROM
node:$NODE_VERSION
AS
builder
ENV
NODE_ENV production
ENV
NODE_ENV production
WORKDIR
/app
WORKDIR
/app
ARG
NPM_TOKEN
# Install NPM with version
ARG
NPM_VERSION=10.5.0
RUN
npm
install
-g
npm@
$NPM_VERSION
# Install dependencies
COPY
package*.json ./
COPY
package*.json ./
ARG
NPM_TOKEN
RUN
echo
"//registry.npmjs.org/:_authToken=
$NPM_TOKEN
"
>
.npmrc
&&
\
RUN
echo
"//registry.npmjs.org/:_authToken=
$NPM_TOKEN
"
>
.npmrc
&&
\
npm
install
-g
npm@
$NPM_VERSION
&&
\
npm ci
--omit
=
dev
&&
\
npm ci
--omit
=
dev
&&
\
rm
-f
.npmrc
rm
-f
.npmrc
# Build app
COPY
. .
COPY
. .
RUN
npm run build
RUN
npm run build
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment