Skip to content

Commit fce5639

Browse files
author
EmbeddedOS CI
committed
ci: add multi-stage Dockerfile for containerized builds and testing
1 parent e152e38 commit fce5639

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ═══════════════════════════════════════════════════════════
2+
# Multi-stage Dockerfile — Python service
3+
# ═══════════════════════════════════════════════════════════
4+
FROM python:3.12-slim AS base
5+
WORKDIR /app
6+
COPY requirements*.txt ./
7+
RUN pip install --no-cache-dir -r requirements.txt 2>/dev/null || true
8+
COPY . .
9+
RUN pip install --no-cache-dir -e . 2>/dev/null || true
10+
11+
FROM base AS test-runner
12+
RUN pip install --no-cache-dir pytest pytest-cov
13+
CMD ["python", "-m", "pytest", "tests/", "-v", "--tb=short"]
14+
15+
FROM base AS production
16+
EXPOSE 8080
17+
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]

0 commit comments

Comments
 (0)