30 lines
833 B
Docker
30 lines
833 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
gcc libpq-dev && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy shared library
|
|
COPY shared/ /app/shared/
|
|
|
|
# Copy service code
|
|
COPY services/data-service/pyproject.toml /app/
|
|
COPY services/data-service/src/ /app/src/
|
|
COPY services/data-service/alembic/ /app/alembic/
|
|
|
|
# Install dependencies
|
|
RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple poetry && \
|
|
poetry config virtualenvs.create false && \
|
|
poetry source add --priority=primary tuna https://pypi.tuna.tsinghua.edu.cn/simple && \
|
|
poetry install --no-interaction --no-ansi --no-root
|
|
|
|
# Set PYTHONPATH to include shared
|
|
ENV PYTHONPATH=/app:/app/src
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["python", "-m", "src.infrastructure.main"]
|