forked from PatrickJS/PatrickJS-starter
-
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.
- Loading branch information
1 parent
7ccce77
commit c3fd2f3
Showing
3 changed files
with
169 additions
and
4 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,39 @@ | ||
.git | ||
.github | ||
.vscode | ||
coverage | ||
|
||
# OS generated files # | ||
.DS_Store | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
|
||
# Node Files # | ||
node_modules | ||
npm-debug.log | ||
npm-debug.log.* | ||
|
||
# Typing # | ||
src/typings/tsd | ||
typings | ||
tsd_typings | ||
|
||
# Dist # | ||
dist | ||
.awcache | ||
.webpack.json | ||
compiled | ||
dll | ||
|
||
# IDE # | ||
.idea | ||
*.swp | ||
|
||
|
||
# Angular # | ||
*.ngfactory.ts | ||
*.css.shim.ts | ||
*.ngsummary.json | ||
*.shim.ngstyle.ts | ||
|
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,4 +1,45 @@ | ||
# Builds a Docker to deliver dist/ | ||
# Alternatively, use nginx:alpine for a smaller image | ||
FROM nginx:latest | ||
COPY dist/ /usr/share/nginx/html | ||
# Usage (given build times depend on machine): | ||
# | ||
# Build SMALL image (no cache; ~20MB, time for build=rebuild = ~360s): | ||
# docker build --squash="true" -t angular-starter . | ||
# | ||
# Build FAST (rebuild) image (cache; >280MB, build time ~360s, rebuild time ~80s): | ||
# docker build -t angular-starter . | ||
# | ||
# Clean (remove intermidiet images): | ||
# docker rmi -f $(docker images -f "dangling=true" -q) | ||
# | ||
# Run image (on localhost:8080): | ||
# docker run --name angular-starter -p 8080:80 angular-starter & | ||
# | ||
# Run image as virtual host (read more: https://github.com/jwilder/nginx-proxy): | ||
# docker run -e VIRTUAL_HOST=angular-starter.your-domain.com --name angular-starter angular-starter & | ||
|
||
FROM nginx:1.13.0-alpine | ||
|
||
# install console and node | ||
RUN apk add --no-cache bash=4.3.46-r5 &&\ | ||
apk add --no-cache openssl=1.0.2k-r0 &&\ | ||
apk add --no-cache nodejs | ||
|
||
# install npm ( in separate dir due to docker cache) | ||
ADD package.json /tmp/npm_inst/package.json | ||
RUN cd /tmp/npm_inst &&\ | ||
npm install &&\ | ||
mkdir -p /tmp/app &&\ | ||
mv /tmp/npm_inst/node_modules /tmp/app/ | ||
|
||
# build and publish application | ||
ADD . /tmp/app | ||
RUN cd /tmp/app &&\ | ||
npm run build:aot &&\ | ||
mv ./dist/* /usr/share/nginx/html/ | ||
|
||
# clean | ||
RUN rm -Rf /tmp/npm_inst &&\ | ||
rm -Rf /tmp/app &&\ | ||
rm -Rf /root/.npm &&\ | ||
apk del nodejs | ||
|
||
# this is for virtual host purposes | ||
EXPOSE 80 |
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