From 00abac3f51b320e0609f982a318f874434d6bf31 Mon Sep 17 00:00:00 2001 From: Ahmed Balde Date: Fri, 14 Aug 2026 13:42:59 -0400 Subject: [PATCH] Fix Milestone 1 CI Docker builds --- .dockerignore | 20 ++++++++++++++++++++ .github/workflows/ci.yml | 12 ++++++------ backend/Dockerfile | 2 +- docker-compose.yml | 4 +++- scripts/verify.ps1 | 6 +++--- 5 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2169ba7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,20 @@ +.git +.env +.venv +__pycache__ +*.pyc + +.mypy_cache +.pytest_cache +.pytest_tmp +.ruff_cache +pytest_tmp + +coverage +htmlcov +uploads +dev.db + +frontend/node_modules +frontend/dist +frontend/coverage diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cbc2cc..e01634b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: - name: Type checking run: | - poetry run mypy backend || true + poetry run mypy backend - name: Run Alembic migrations and backend tests env: @@ -60,12 +60,12 @@ jobs: working-directory: frontend run: | npm ci - npm run lint || true - npm run typecheck || true - npm run test -- --coverage || true - npm run build || true + npm run lint + npm run typecheck + npm run test -- --run --coverage + npm run build - name: Build Docker images run: | docker build -f ./backend/Dockerfile -t dip-backend . - docker build -t dip-frontend ./frontend + docker build -f ./frontend/Dockerfile -t dip-frontend . diff --git a/backend/Dockerfile b/backend/Dockerfile index dd77b72..078fdda 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,7 +3,7 @@ WORKDIR /app COPY pyproject.toml poetry.lock* /app/ RUN apt-get update && apt-get install -y --no-install-recommends gcc libpq-dev && rm -rf /var/lib/apt/lists/* RUN pip install poetry && poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi -COPY backend /app +COPY backend /app/backend COPY alembic.ini /app/ COPY alembic /app/alembic COPY backend/docker-entrypoint.sh /app/docker-entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index cf0b785..e67c40c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,7 +40,9 @@ services: retries: 5 frontend: - build: ./frontend + build: + context: . + dockerfile: frontend/Dockerfile ports: - '3000:3000' depends_on: diff --git a/scripts/verify.ps1 b/scripts/verify.ps1 index ec0c2b2..f22ba4c 100644 --- a/scripts/verify.ps1 +++ b/scripts/verify.ps1 @@ -120,10 +120,10 @@ Push-Location frontend # Find npm command on Windows (npm or npm.cmd) or Unix (npm) $npmCmd = $null -if (Get-Command 'npm' -ErrorAction SilentlyContinue) { - $npmCmd = 'npm' -} elseif (Get-Command 'npm.cmd' -ErrorAction SilentlyContinue) { +if (Get-Command 'npm.cmd' -ErrorAction SilentlyContinue) { $npmCmd = 'npm.cmd' +} elseif (Get-Command 'npm' -ErrorAction SilentlyContinue) { + $npmCmd = 'npm' } else { Write-Host 'npm is not installed or not on PATH. Please install Node.js LTS and ensure npm is on PATH, then rerun verification.' Pop-Location