Skip to content

Commit

Permalink
Merge pull request #23 from Sebastian-411/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sebastian-411 authored May 3, 2024
2 parents 5f82e02 + 826a245 commit c6c2391
Show file tree
Hide file tree
Showing 27 changed files with 814 additions and 197 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/frontend_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to Amazon ECS

on:
push:
branches:
- master

env:
AWS_REGION: us-east-1
ECS_CLUSTER: medical_assistant_cluster
ECS_SERVICE: medical_assistant_frontend
ECR_REPOSITORY: 891377268337.dkr.ecr.us-east-1.amazonaws.com/medical_assistant_frontend
API_KEY: ${{secrets.API_KEY}}

jobs:
build_image_backend:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
IMAGE_TAG: lastest
run: |
docker build -t $ECR_REPOSITORY:$IMAGE_TAG ./frontend
docker push $ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v2


deploy_backend:
runs-on: ubuntu-latest
needs: build_image_backend
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Deploy to ECS
run: |
aws ecs update-service --cluster ${{ env.ECS_CLUSTER }} --service ${{ env.ECS_SERVICE }} --force-new-deployment
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/model/dataset/archive/Brain Tumor Data Set/Brain Tumor Data Set/Brain Tumor
/model/dataset/archive/Brain Tumor Data Set/Brain Tumor Data Set/Healthy
.pnpm*/
/model/resource
/backend/__pycache__
/backend/.pytest_cache
Expand All @@ -8,4 +9,5 @@
/backend/test/__pycache__
/backend/key/settings_token.pkl
/model/gemini-model-build.ipynb
/backend/.env
/backend/.env
/backend/venv
5 changes: 5 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
venv
__pycache__
Dockerfile
.dockerignore
.gitignore
14 changes: 4 additions & 10 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
FROM python:3.9-slim
# Slim image as builder base
FROM python:3.12.3-slim

WORKDIR /app

COPY requirements.txt .


RUN pip install --upgrade pip setuptools


RUN pip install -r requirements.txt

RUN pip install --upgrade pip setuptools \
&& pip install --no-cache -r requirements.txt
COPY . .

EXPOSE 8000

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
7 changes: 7 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.eslintrc.cjs
node_modules/
package-lock.json
pnpm-lock.json
.prettierrc
.gitignore
README.md
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon-32x32.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Brain Tumor Checker</title>
</head>
Expand Down
4 changes: 4 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"daisyui": "^4.10.2",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"vite": "^5.2.0"
}
}
Loading

0 comments on commit c6c2391

Please sign in to comment.