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
98eb876d
Commit
98eb876d
authored
4 months ago
by
Dmitriy Safronov
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Dockerfile with versions for Dependabot
Signed-off-by:
Dmitriy Safronov
<
zimniy@cyberbrain.pw
>
parent
86671471
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+4
-9
4 additions, 9 deletions
Dockerfile
with
4 additions
and
9 deletions
Dockerfile
+
4
−
9
View file @
98eb876d
# VERSIONS
ARG
NODE_VERSION=20.13.1
ARG
NGINX_VERSION=1.26.0
# --------------> The builder image
# --------------> The builder image
FROM
node:
$NODE_VERSION
AS
builder
FROM
node:
20.13.1
AS
builder
ENV
NODE_ENV=production
ENV
NODE_ENV=production
WORKDIR
/app
WORKDIR
/app
# Install NPM with version
# Install NPM with version
ARG
NPM_VERSION=10.8.0
RUN
npm
install
-g
npm@10.8.0
RUN
npm
install
-g
npm@
$NPM_VERSION
# Install dependencies
# Install dependencies
COPY
package*.json ./
COPY
package*.json ./
ARG
NPM_TOKEN
ARG
NPM_TOKEN
...
@@ -18,8 +13,8 @@ RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \
...
@@ -18,8 +13,8 @@ RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && \
# Build app
# Build app
COPY
. .
COPY
. .
RUN
npm run build
RUN
npm run build
# --------------> The production image
# --------------> The production image
FROM
nginxinc/nginx-unprivileged:
$NGINX_VERSION
AS
production
FROM
nginxinc/nginx-unprivileged:
1.26.0
AS
production
# Copy built assets from `builder` image
# Copy built assets from `builder` image
COPY
--from=builder /app/build/ /usr/share/nginx/html/
COPY
--from=builder /app/build/ /usr/share/nginx/html/
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