-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (37 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
48 lines (37 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Use Chainguard's Python image
FROM python:3.14.0rc1-slim AS builder
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV VIRTUAL_ENV=/app/.venv
# Set the working directory
WORKDIR /app
# Copy the requirements file
COPY pyproject.toml .
COPY uv.lock .
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY README.md .
# Install the dependencies using uv
RUN uv venv
ENV PATH="/app/.venv/bin:$PATH"
RUN echo $PATH
RUN CC=gcc uv sync --frozen --no-dev
#FROM cgr.dev/chainguard/python:latest-dev
FROM python:3.14.0rc1-slim
# Set the working directory
WORKDIR /app
# Copy the application code
COPY ./lfweb ./lfweb
# Copy the dependencies from the builder image
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
# Copy the rest of the application code
RUN ls -la /app
RUN ls -la /app/.venv/bin
RUN python --version
# Expose the port the app runs on
EXPOSE 8000
# Set the FLASK_APP environment variable
ENV FLASK_APP=lfweb
# Command to run the application using Gunicorn
ENTRYPOINT ["/app/.venv/bin/gunicorn", "-b", "0.0.0.0:8000", "lfweb:create_app()"]