Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
sudo: required
language: node_js

node_js:
- "node"

env:
global:
- COMMIT=${TRAVIS_COMMIT::8}

services:
- docker

addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

before_script:
- npm install

script:
- npm run test -- --watch=false
- npm run e2e

after_success:
- if ["$TRAVIS_BRANCH" == "master"]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
export REPO=wizofgoz/evecommander-web;
docker build -t $REPO:$COMMIT .;
docker tag $REPO:$COMMIT $REPO:latest;
docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER;
docker push $REPO;
fi
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Stage 0, based on Node.js, to build and compile Angular
FROM node:latest as node
WORKDIR /app
COPY package.json /app/
RUN npm install
COPY ./ /app/
ARG env=prod
RUN npm run build -- --prod --environment $env

# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:alpine
COPY --from=node /app/dist/ /usr/share/nginx/html
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
8 changes: 8 additions & 0 deletions nginx-custom.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
Loading