Skip to content

Commit 89ff636

Browse files
committed
build(cert): ensure OpenCV runtime libs and uv-managed venv in backend image
1 parent eda2b02 commit 89ff636

4 files changed

Lines changed: 1120 additions & 884 deletions

File tree

cert/backend/Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
# Use an official Python runtime as a parent image
22
FROM python:3.11-slim
33

4+
# 기본 Python 런타임 환경 변수
5+
ENV PYTHONDONTWRITEBYTECODE=1 \
6+
PYTHONUNBUFFERED=1 \
7+
TZ=Asia/Seoul \
8+
VIRTUAL_ENV=/app/.venv \
9+
PATH="/app/.venv/bin:${PATH}"
10+
411
# Set the working directory in the container
512
WORKDIR /app
613

714
# Install tzdata and set timezone to Asia/Seoul
815
RUN apt-get update && \
9-
apt-get install -y --no-install-recommends tzdata && \
16+
apt-get install -y --no-install-recommends tzdata libgl1 libglib2.0-0 && \
1017
ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \
1118
echo "Asia/Seoul" > /etc/timezone && \
1219
apt-get clean && rm -rf /var/lib/apt/lists/*
1320

14-
ENV TZ=Asia/Seoul
21+
# install uv for improved package management
22+
RUN pip install --no-cache-dir "uv>=0.5.0"
1523

16-
# Copy the dependency files
17-
COPY requirements.txt .
18-
COPY uv.lock .
24+
# Copy only the dependency files to leverage Docker cache
25+
COPY pyproject.toml uv.lock ./
1926

20-
# Install any needed packages specified in requirements.txt
21-
# Using uv pip install for faster and more reliable dependency management
22-
RUN pip install uv && uv pip install --system -r requirements.txt
27+
# Install the dependencies into the project virtualenv
28+
RUN uv sync --frozen
2329

2430
# Copy the rest of the application code
2531
COPY . .

cert/backend/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
88
"aiohttp>=3.12.15",
9-
"dotenv>=0.9.9",
9+
"aiosmtplib>=4.0.1",
1010
"fastapi>=0.109.1",
11+
"gunicorn>=21.2.0",
1112
"invisible-watermark>=0.2.0",
12-
"opencv-python>=4.11.0.86",
13+
"opencv-python-headless>=4.11.0.86",
1314
"pillow>=10.1.0",
1415
"pydantic>=2.5.3",
1516
"pydantic-settings>=2.1.0",
@@ -23,5 +24,4 @@ dependencies = [
2324

2425
[dependency-groups]
2526
dev = [
26-
"aiosmtplib>=4.0.1",
2727
]

cert/backend/requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)