Skip to content

Commit

Permalink
Update CI/CD workflow and Dockerfile for FastAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
sahi-mfg committed Dec 16, 2023
1 parent 0e50826 commit f100112
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 85 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Build the FastAPI Docker image
run: docker build . --file Dockerfile.fastapi --tag age-detection-api-image
- name: Build the FastAPI Docker image
run: docker build . --file Dockerfile --tag age-detection-api-image

- name: Build the streamlit Docker image
run: docker build . --file Dockerfile.streamlit --tag age-detection-ui-image

- name: Run tests
run: docker run age-detection-api-image python -m pytest tests/
- name: Run tests
run: docker run age-detection-api-image python -m pytest tests/
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
up:
docker-compose up

down:
docker-compose down

test:
python -m pytest tests/test_predict.py

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Age detection App

## Description
API to detect age of a person from an image and streamlit app to use the API.

API to detect age of a person from an image.

## Installation

1. Clone the repository
2. Install the requirements using the command `pip install -r requirements.txt`
3. Run the app using the command `python -m streamlit run ui/app.py`
3. Run the app using the command `python app/main.py`

## Dependencies

Expand Down
16 changes: 0 additions & 16 deletions docker-compose.yml

This file was deleted.

11 changes: 2 additions & 9 deletions render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ services:
- type: web
name: fastapi-service
env: docker
dockerfilePath: Dockerfile.fastapi
buildCommand: docker build -f Dockerfile.fastapi -t fastapi-service .
dockerfilePath: Dockerfile
buildCommand: docker build -f Dockerfile -t fastapi-service .
startCommand: docker run -p 10000:80 fastapi-service

- type: web
name: streamlit-service
env: docker
dockerfilePath: Dockerfile.streamlit
buildCommand: docker build -f Dockerfile.streamlit -t streamlit-service .
startCommand: docker run -p 8501:8501 streamlit-service
15 changes: 0 additions & 15 deletions ui/Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions ui/app.py

This file was deleted.

0 comments on commit f100112

Please sign in to comment.