-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
39 lines (30 loc) · 1.06 KB
/
Dockerfile
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
FROM python:3.12-slim AS base
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PYSETUP_PATH="/opt/pysetup"
ENV PATH="/root/.local/bin:/root/.cargo/bin:$PATH"
WORKDIR $PYSETUP_PATH
FROM base AS builder
# Install build deps
RUN apt-get update && \
apt-get install -y curl clang gcc git libssl-dev make pkg-config && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install UV
COPY uv-version ./
RUN UV_VERSION=$(cat uv-version) && curl -LsSf https://astral.sh/uv/$UV_VERSION/install.sh | sh
# Install project
COPY . ./
RUN uv pip install . --system
FROM base AS application
ENV CATALOG_PATH=/catalog
# Copy python environment from builder
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY ./nautilus_data $PYSETUP_PATH/nautilus_data
# Ensure the catalog and backtest directories exist
RUN mkdir -p /opt/pysetup/catalog/backtest
# Generate data catalog
RUN python -m nautilus_data.hist_data_to_catalog