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

Circleci project setup #225

Closed
wants to merge 19 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
40 changes: 40 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

version: 2.1

workflows:
build:
jobs:
- build
jobs:
build:
machine: true
steps:
- checkout
- run:
name: build
command: |
# Build
echo 'START BUILDING'
docker build -t udagram-api-feed ./udagram-api-feed
docker build -t udagram-api-user ./udagram-api-user
docker build -t udagram-frontend ./udagram-frontend
docker build -t reverseproxy ./udagram-reverseproxy

# Tagging
echo 'START TAGGING'
docker tag udagram-api-feed duydn97/udagram-api-feed:v1
docker tag udagram-api-user duydn97/udagram-api-user:v1
docker tag udagram-frontend duydn97/udagram-frontend:v1
docker tag reverseproxy duydn97/reverseproxy:v1

echo 'DOCKER IMAGE LS'
docker image ls

- run:
name: after_success
command: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push duydn97/udagram-api-feed:v1
docker push duydn97/udagram-api-user:v1
docker push duydn97/udagram-frontend:v1
docker push duydn97/reverseproxy:v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ venv/
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
*set_env.sh
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: "3"
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions udagram-api-feed/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:13
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies

COPY package*.json ./
RUN npm install --save-dev @types/[email protected]
RUN npm install --save-dev @types/[email protected]
RUN npm install --save-dev @types/[email protected]
RUN npm install --save-dev @types/[email protected]
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