Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Travis continuous integration pipeline #211

Closed
wants to merge 4 commits into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Assuming the .travis.yml file is in the project directory, and there is a separate sub-directory for each service
## Use either `docker-compose` or individual `docker build` commands
## Build
- docker build -t udagram-api-feed ./udagram-api-feed
- docker build -t udagram-api-user ./udagram-api-user
- docker build -t udagram-api-frontend ./udagram-api-frontend
- docker build -t udagram-api-reverseproxy ./udagram-api-reverseproxy
## Tagging
- docker tag udagram-api-feed dattm283/udagram-api-feed:v1
- docker tag udagram-api-user dattm283/udagram-api-user:v1
- docker tag udagram-api-frontend dattm283/udagram-api-frontend:v1
- docker tag udagram-api-reverseproxy dattm283/udagram-api-reverseproxy:v1
## Push
## Assuming DOCKER_PASSWORD and DOCKER_USERNAME are set in the Travis repository settings
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push dattm283/udagram-api-feed:v1
- docker push dattm283/udagram-api-user:v1
- docker push dattm283/udagram-api-frontend:v1
- docker push dattm283/udagram-api-reverseproxy:v1
18 changes: 18 additions & 0 deletions docker-compose-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "2"
services:
reverseproxy:
build:
context: ./udagram-reverseproxy
image: reverseproxy
backend_user:
build:
context: ./udagram-api-user
image: udagram-api-user
backend_feed:
build:
context: ./udagram-api-feed
image: udagram-api-feed
frontend:
build:
context: ./udagram-frontend
image: udagram-frontend:local
40 changes: 40 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "3"
services:
reverseproxy:
image: reverseproxy
ports:
- 8080:8080
restart: always
depends_on:
- backend-user
- backend-feed
backend-user:
image: udagram-api-user
environment:
POSTGRES_USERNAME: $POSTGRES_USERNAME
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
POSTGRES_HOST: $POSTGRES_HOST
AWS_REGION: $AWS_REGION
AWS_PROFILE: $AWS_PROFILE
AWS_BUCKET: $AWS_BUCKET
JWT_SECRET: $JWT_SECRET
URL: "http://localhost:8100"
backend-feed:
image: udagram-api-feed
volumes:
- $HOME/.aws:/root/.aws
environment:
POSTGRES_USERNAME: $POSTGRES_USERNAME
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
POSTGRES_HOST: $POSTGRES_HOST
AWS_REGION: $AWS_REGION
AWS_PROFILE: $AWS_PROFILE
AWS_BUCKET: $AWS_BUCKET
JWT_SECRET: $JWT_SECRET
URL: "http://localhost:8100"
frontend:
image: udagram-frontend:local
ports:
- "8100:80"
11 changes: 0 additions & 11 deletions set_env.sh

This file was deleted.

File renamed without changes.
11 changes: 11 additions & 0 deletions udagram-api-feed/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:16
## Create app directory
WORKDIR /usr/src/app
## Install app dependencies
## A wildcard is used to ensure both package.json AND package-lock.json are copied where available (npm@5+)
COPY package*.json ./
RUN npm ci
## Bundle app source
COPY . .
EXPOSE 8080
CMD [ "npm", "run", "prod" ]
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Loading