Merge pull request #28 from aimingmed/feature/backend-frontend-structure

test
This commit is contained in:
Hong Kai LEE 2025-04-11 22:42:32 +08:00 committed by GitHub
commit 7b403762ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 22 deletions

View File

@ -72,12 +72,14 @@ jobs:
-e TESTING=0 \ -e TESTING=0 \
-p 8004:8765 \ -p 8004:8765 \
${{ env.IMAGE }}:latest ${{ env.IMAGE }}:latest
- name: Pytest # - name: Pytest
run: docker exec backend pipenv run python -m pytest . # run: docker exec backend pipenv run python -m pytest tests --disable-warnings --maxfail=5
# - name: Flake8 # - name: Flake8
# run: docker exec backend pipenv run python -m flake8 . # run: docker exec backend pipenv run python -m flake8 .
# - name: Black # - name: Black
# run: docker exec backend pipenv run python -m black . --check # run: docker exec backend pipenv run python -m black . --check
# - name: isort # - name: isort
# run: docker exec backend pipenv run python -m isort . --check-only # run: docker exec backend pipenv run python -m isort . --check-only
- name: Cleanup container at end of job
if: always()
run: docker stop backend || true && docker rm backend || true

View File

@ -80,5 +80,6 @@ RUN chown -R app:app $APP_HOME
# change to the app user # change to the app user
USER app USER app
# run gunicorn # run gunicorn
CMD pipenv run gunicorn --bind 0.0.0.0:$PORT backend.main:app -k uvicorn.workers.UvicornWorker CMD pipenv run gunicorn --bind 0.0.0.0:$PORT backend.main:app -k uvicorn.workers.UvicornWorker

View File

@ -1,5 +1,3 @@
version: "3.9"
services: services:
# streamlit: # streamlit:
# build: ./streamlit # build: ./streamlit
@ -9,32 +7,31 @@ services:
# volumes: # volumes:
# - ./llmops/src/rag_cot_evaluation/chroma_db:/app/llmops/src/rag_cot_evaluation/chroma_db # - ./llmops/src/rag_cot_evaluation/chroma_db:/app/llmops/src/rag_cot_evaluation/chroma_db
backend: # backend:
build: # build:
context: ./backend # context: ./backend
dockerfile: Dockerfile # dockerfile: Dockerfile
container_name: backend # container_name: backend
platform: linux/amd64 # platform: linux/amd64
command: pipenv run uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 8000 # command: pipenv run uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 8000
volumes: # volumes:
- ./backend:/usr/src/app # - ./backend:/usr/src/app
ports: # ports:
- "8004:8000" # - "8004:8000"
environment: # environment:
- ENVIRONMENT=dev # - ENVIRONMENT=dev
- TESTING=0 # - TESTING=0
frontend: frontend:
build: build:
context: ./frontend context: ./frontend
dockerfile: Dockerfile.local dockerfile: Dockerfile.local
container_name: frontend container_name: frontend
platform: linux/amd64
volumes: volumes:
- ./frontend:/usr/src/app - ./frontend:/usr/src/app
ports: ports:
- "3004:5173" - "3004:5173"
depends_on: # depends_on:
- backend # - backend
environment: environment:
LOG_LEVEL: "DEBUG" LOG_LEVEL: "DEBUG"