-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (42 loc) · 1.62 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (42 loc) · 1.62 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
49
# Dockerfile for BTC RPC Data Container
# This container provides a portable data dump of Bitcoin blockchain data
FROM python:3.12-slim
LABEL org.opencontainers.image.source="https://github.com/zarca-ai/BTC-RPC-Data"
LABEL org.opencontainers.image.description="Bitcoin RPC and OHLCV data container"
LABEL org.opencontainers.image.licenses="MIT"
# Set working directory
WORKDIR /app
# Install minimal dependencies for data access
RUN pip install --no-cache-dir numpy==2.4.0 pandas==2.3.3 pyarrow==22.0.0
# Copy data folder
COPY data/ ./data/
# Create a simple Python script to help users explore the data
RUN echo 'import pandas as pd\n\
import os\n\
\n\
def list_data_files():\n\
"""List all parquet files in the data directory."""\n\
for root, dirs, files in os.walk("data"):\n\
for file in files:\n\
if file.endswith(".parquet"):\n\
print(os.path.join(root, file))\n\
\n\
def load_ohlcv():\n\
"""Load BTC/USDT OHLCV data."""\n\
return pd.read_parquet("data/cryptodata/dynamic_btc.parquet")\n\
\n\
def load_onchain():\n\
"""Load all on-chain block stats data."""\n\
return pd.read_parquet("data/onchain/BTC/block_stats_fragments")\n\
\n\
print("BTC RPC Data Container")\n\
print("======================")\n\
print("Available functions:")\n\
print(" list_data_files() - List all parquet files")\n\
print(" load_ohlcv() - Load BTC/USDT OHLCV data")\n\
print(" load_onchain() - Load on-chain block stats")\n\
print()\n\
list_data_files()\n\
' > /app/data_explorer.py
# Default command: start Python interactive shell with data explorer
CMD ["python", "-i", "/app/data_explorer.py"]