feat: migrate from venv to uv
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,11 +1,13 @@
|
||||
FROM python:3.12-alpine
|
||||
FROM ghcr.io/astral-sh/uv:python3.12-alpine
|
||||
|
||||
ARG FLADO_DATABASE_URI=sqlite:////app/instance/flado.sqlite
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
FLASK_APP=flado.app:create_app \
|
||||
FLADO_DATABASE_URI=${FLADO_DATABASE_URI}
|
||||
FLADO_DATABASE_URI=${FLADO_DATABASE_URI} \
|
||||
VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -14,12 +16,9 @@ RUN addgroup -S app && adduser -S app -G app
|
||||
# Install curl for healthcheck
|
||||
RUN apk add --no-cache curl
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
COPY . ./
|
||||
|
||||
RUN uv sync --frozen --no-dev --no-cache
|
||||
RUN mkdir -p /app/instance && chown -R app:app /app/instance
|
||||
|
||||
VOLUME ["/app/instance"]
|
||||
@@ -31,4 +30,4 @@ EXPOSE 5000
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl --fail --silent --show-error http://localhost:5000/health || exit 1
|
||||
|
||||
CMD ["sh", "-c", "mkdir -p /app/instance && flask db upgrade && gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 --access-logfile - --error-logfile - wsgi:app"]
|
||||
CMD ["sh", "-c", "mkdir -p /app/instance && uv run flask db upgrade && gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 --access-logfile - --error-logfile - wsgi:app"]
|
||||
|
||||
Reference in New Issue
Block a user