forked from LiveCarta/CommentAutomation
Added entrypoint, changed Dockerfile to multi-target variant
This commit is contained in:
33
Dockerfile
33
Dockerfile
@@ -1,18 +1,41 @@
|
||||
FROM python:3.12-slim
|
||||
FROM python:3.12-slim AS base
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
UV_LINK_MODE=copy
|
||||
UV_LINK_MODE=copy \
|
||||
PYTHONPATH=/app/src
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip install --no-cache-dir uv
|
||||
|
||||
COPY pyproject.toml ./
|
||||
RUN uv sync --no-install-project
|
||||
COPY pyproject.toml uv.lock ./
|
||||
|
||||
|
||||
FROM base AS local_test
|
||||
|
||||
RUN uv sync --all-groups --no-install-project
|
||||
|
||||
COPY src ./src
|
||||
COPY tests ./tests
|
||||
COPY entrypoint.sh ./entrypoint.sh
|
||||
RUN chmod +x ./entrypoint.sh
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uv", "run", "uvicorn", "comment_automation.main:app", "--app-dir", "src", "--host", "0.0.0.0", "--port", "8000"]
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
CMD ["http"]
|
||||
|
||||
|
||||
FROM base AS production
|
||||
|
||||
RUN uv sync --no-dev --no-install-project
|
||||
|
||||
COPY src ./src
|
||||
COPY entrypoint.sh ./entrypoint.sh
|
||||
RUN chmod +x ./entrypoint.sh
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
CMD ["http"]
|
||||
|
||||
Reference in New Issue
Block a user