Configure docker-compose, travis multistage build

This commit is contained in:
Matt Rider 2019-01-03 20:22:29 -02:00
parent 5778ef3bc0
commit e88b674a29
4 changed files with 16 additions and 3 deletions

View File

@ -18,8 +18,8 @@ before_install:
- sudo mv docker-compose /usr/local/bin
install:
- docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT -t humanconnection/nitro-web .
- docker-compose -f docker-compose.yml up -d
- docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT --target production -t humanconnection/nitro-web .
- docker-compose -f docker-compose.travis.yml up -d
- git clone https://github.com/Human-Connection/Nitro-Backend.git ../Nitro-Backend
- git -C "../Nitro-Backend" checkout $TRAVIS_BRANCH || echo "Branch \`$TRAVIS_BRANCH\` does not exist, falling back to \`master\`"
- docker-compose -f ../Nitro-Backend/docker-compose.yml -f ../Nitro-Backend/docker-compose.travis.yml up -d

View File

@ -2,6 +2,9 @@ version: '3.7'
services:
webapp:
build:
context: .
target: builder
volumes:
- .:/nitro-web
- node_modules:/nitro-web/node_modules

View File

@ -0,0 +1,8 @@
version: "3.7"
services:
backend:
image: humanconnection/nitro-web:builder
build:
context: .
target: builder

View File

@ -3,7 +3,9 @@ version: '3.7'
services:
webapp:
image: humanconnection/nitro-web:latest
build: .
build:
context: .
target: production
ports:
- 3000:3000
- 8080:8080