Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
angular-testt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
angular-testt
Commits
0dab7893
Commit
0dab7893
authored
Nov 19, 2018
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Dockerfile
parent
3faa31f9
Pipeline
#601
failed with stages
in 3 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
27 deletions
+16
-27
Dockerfile
Dockerfile
+16
-27
No files found.
Dockerfile
View file @
0dab7893
### STAGE 1: Build ###
# Create image based on the official Node 6 image from dockerhub
FROM
node:6
#
We label our stage as 'builder'
FROM
node:9-alpine as builder
#
Create a directory where our app will be placed
RUN
mkdir
-p
/usr/src/app
COPY
package.json package-lock.json ./
# Change directory so that our commands run inside this new directory
WORKDIR
/usr/src/app
RUN
npm
set
progress
=
false
&&
npm config
set
depth 0
&&
npm cache clean
--force
# Copy dependency definitions
COPY
package.json /usr/src/app
#
# Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN
npm i
&&
mkdir
/ng-app
&&
cp
-R
./node_modules ./ng-app
#
Install dependecies
RUN
npm
i
nstall
WORKDIR
/ng-app
# Get all the code needed to run the app
COPY
. /usr/src/app
COPY
. .
# Expose the port the app runs in
EXPOSE
4200
## Build the angular app in production mode and store the artifacts in dist folder
RUN $(
npm bin
)
/ng build
--prod
### STAGE 2: Setup ###
FROM
nginx:1.13.3-alpine
## Copy our default nginx config
COPY
nginx/default.conf /etc/nginx/conf.d/
## Remove default nginx website
RUN
rm
-rf
/usr/share/nginx/html/
*
## From 'builder' stage copy over the artifacts in dist folder to default nginx public folder
COPY
--from=builder /ng-app/dist /usr/share/nginx/html
CMD
["nginx", "-g", "daemon off;"]
# Serve the app
CMD
["npm", "start"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment