-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 829 Bytes
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 829 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
# Multi-stage Dockerfile for allocator-bot
# Build stage
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
ENV UV_PYTHON_DOWNLOADS=0
RUN apt-get update && apt-get install -y build-essential git
WORKDIR /app
COPY . /app
RUN uv sync --locked --no-dev
# Runtime stage
FROM python:3.13-slim-bookworm
WORKDIR /app
# Create non-root user
RUN groupadd --gid 1000 app && useradd --uid 1000 --gid app --shell /bin/bash --create-home app
# Copy application from builder
COPY --from=builder --chown=app:app /app /app
# Switch to non-root user
USER app
# Place executables in PATH
ENV PATH="/app/.venv/bin:$PATH"
# Expose port
EXPOSE 4299
# Run the application
CMD ["openbb-api", "--app", "allocator_bot.__main__:get_app", "--factory", "--host", "0.0.0.0", "--port", "4299"]