-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 1020 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 1020 Bytes
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
# syntax=docker/dockerfile:1
FROM dhi.io/bun:1-dev AS frontend-builder
WORKDIR /frontend
COPY package.json bun.lock tsconfig.json ./
RUN --mount=type=cache,target=/root/.bun bun ci
COPY app/assets ./app/assets
COPY app/templates ./app/templates
RUN mkdir -p app/static/js app/static/css && bun run build
FROM python:3.14-slim-bookworm AS runtime
WORKDIR /service_root
COPY requirements.txt ./
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-compile -r requirements.txt
# Install curl for health checks
RUN apt-get update && apt-get install --no-install-recommends -y curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN groupadd --system appgroup && \
useradd --system --gid appgroup --no-create-home appuser
COPY --chown=appuser:appgroup app ./app
COPY --from=frontend-builder --chown=appuser:appgroup /frontend/app/static/ ./app/static/
USER appuser
EXPOSE 8001
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001", "--forwarded-allow-ips", "*"]