1
0
forked from erp-dev/erp
Files
erpnew/Dockerfile

36 lines
854 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# syntax=docker/dockerfile:1
FROM python:3.14-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_ROOT_USER_ACTION=ignore
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential curl postgresql-client \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml /app/
RUN pip install --upgrade pip \
&& pip install --no-cache-dir uv \
&& uv pip install --system .
COPY . /app
CMD ["python", "manage.py", "runserver", "0.0.0.0:8100"]
FROM base AS celery
CMD ["celery", "-A", "flower", "worker", "-l", "info", "--concurrency=2"]
# 默认产物runtime 镜像(用于 web / celery_worker / celery_beat 共用,通过 compose 覆盖 command
FROM base AS runtime
CMD ["uvicorn", "flower.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]