添加docker部署代码
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
libssl-dev \
|
||||
libffi-dev \
|
||||
curl \
|
||||
libexpat1 \
|
||||
gdal-bin \
|
||||
libgdal-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
||||
|
||||
COPY pyproject.toml ./
|
||||
COPY app_mars.py ./
|
||||
|
||||
RUN uv pip install --system -e .
|
||||
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
EXPOSE 8002
|
||||
|
||||
CMD ["uv", "run", "uvicorn", "app_mars:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user