Skip to content

Commit

Permalink
init with travis build config
Browse files Browse the repository at this point in the history
changed build options
  • Loading branch information
vinay-lanka committed Dec 15, 2020
0 parents commit dac02bf
Show file tree
Hide file tree
Showing 9 changed files with 3,731 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
sudo: required
services:
- docker
env:
- DOCKER_COMPOSE_VERSION=1.27.4

before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose -p ci up -d

scripts:
- docker wait ci_node_app_test_1

after_success:
- docker-compose down
- docker build -t vinaylanka/water-level-api .
#Log in
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
#push images
- docker push vinaylanka/water-level-api
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts-alpine

RUN apk add --no-cache curl python2 g++ make

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

CMD [ "npm", "run", "start" ]
13 changes: 13 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts-alpine

RUN apk add --no-cache curl python2 g++ make

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

CMD [ "npm", "run", "test" ]
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3'
services:

redis-server:
image: 'redis'

node_app:
environment:
- CHOKIDAR_USEPOLLING=true
build: .
ports:
- "3000:3000"
volumes:
- /app/node_modules
- .:/app
devices:
- "/dev/mem:/dev/mem"
privileged: true

node_app_test:
environment:
- NODE_ENV=test
build:
context: .
dockerfile: Dockerfile.test
volumes:
- /app/node_modules
- .:/app
Loading

0 comments on commit dac02bf

Please sign in to comment.