Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
96f47c12
Commit
96f47c12
authored
3 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Update Dockerfile for Node.js 16
parent
b1292cdc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+8
-11
8 additions, 11 deletions
Dockerfile
with
8 additions
and
11 deletions
Dockerfile
+
8
−
11
View file @
96f47c12
FROM
node:1
4
.1
5.1
-alpine
FROM
node:1
6
.1
3.0
-alpine
ARG
API_URL
# Create app directory
RUN
mkdir
/opt/app
&&
chown
node:node /opt/app
RUN
apk add
--update
git
&&
\
rm
-rf
/tmp/
*
/var/cache/apk/
*
# Based on https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
WORKDIR
/opt/app
# Create app directory
WORKDIR
/usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
...
...
@@ -21,14 +18,14 @@ COPY babel.config.js ./
# Bundle app source
COPY
src ./src
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user
USER
node
# Run the scripts defined in package.json
RUN
npm
install
&&
\
API_URL=$API_URL npm run build
EXPOSE
3001
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user
USER
node
# Express server handles the backend functionality and also serves the React app
CMD
["node", "/
opt
/app/dist/server"]
CMD
["node", "/
usr/src
/app/dist/server"]
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