Skip to content

Commit

Permalink
feat: add docker-compose file and modified A2_Part1.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
gerbie-goober committed Aug 4, 2024
1 parent b16c8dd commit 282a68d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Build Docker Image | CI Pipeline

on:
push:
Expand All @@ -11,6 +11,8 @@ jobs:
build_and_push_docker_image:

runs-on: ubuntu-latest

timeout-minutes: 30

steps:
- name: Checkout code
Expand All @@ -22,10 +24,8 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build the Docker images
run: |
docker build -t cscc01-linkup_frontend:latest ./frontend
docker build -t cscc01-linkup_backend:latest ./backend
- name: Build the Docker images
run: docker-compose build

- name: Tag and push the Docker images
run: |
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/A2_Part2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Pull Docker Container & Run Automated Tests | CD Pipeline

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

deploy:
runs-on: ubuntu-latest

27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services: # Start with this tag. This will contain all the containers you want to run
frontend:
build: # Build the image from the Dockerfile
context: ./frontend # Path to the Dockerfile
dockerfile: Dockerfile # Name of the Dockerfile
container_name: frontend
ports:
- '80:3000'
restart: always

redis:
container_name: redis
image: redis:latest
restart: always
ports:
- '6379:6379'

backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend
environment: # Environment variables to be passed to the container
MONGODB_URI: "mongodb+srv://Cluster20901:[email protected]/linkup?retryWrites=true&w=majority&appName=Cluster20901"
ports:
- "5000:5000"
restart: always

0 comments on commit 282a68d

Please sign in to comment.