for deploy

This commit is contained in:
k
2026-04-21 19:41:11 +08:00
parent 3268080401
commit 3056635a5c
5 changed files with 115 additions and 14 deletions
+27
View File
@@ -0,0 +1,27 @@
FROM python:3.11-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libpq-dev curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps first (layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# App source
COPY . .
# Make entrypoint executable
RUN chmod +x entrypoint.sh
# Non-root user for security
RUN useradd -m appuser && chown -R appuser /app
USER appuser
EXPOSE 8000
# Runs: alembic upgrade head → uvicorn
ENTRYPOINT ["./entrypoint.sh"]