-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 840 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 840 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
ARG BASE_IMAGE=python:3.12-slim
FROM ${BASE_IMAGE}
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Set working directory
WORKDIR /app
# Enable bytecode compilation for faster startup
ENV UV_COMPILE_BYTECODE=1
# Copy from cache instead of linking (for mounted volumes)
ENV UV_LINK_MODE=copy
# Install dependencies using lockfile
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project --no-dev
# Copy application code
COPY utils.py utils.py
COPY inbound/ inbound/
COPY outbound/ outbound/
# Expose port
EXPOSE 8000
# Run the inbound server by default (override with outbound.server for outbound)
CMD ["uv", "run", "python", "-m", "inbound.server"]