-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
80 lines (65 loc) · 2.51 KB
/
Dockerfile
File metadata and controls
80 lines (65 loc) · 2.51 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# IPFS Datasets Python
# A unified interface for data processing and distribution across decentralized networks
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
build-essential \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set up working directory
WORKDIR /app
# Install IPFS (support both ARM64 and AMD64)
RUN cd /tmp \
&& ARCH=$(uname -m) \
&& if [ "$ARCH" = "aarch64" ]; then IPFS_ARCH="arm64"; else IPFS_ARCH="amd64"; fi \
&& wget https://dist.ipfs.io/kubo/v0.23.0/kubo_v0.23.0_linux-${IPFS_ARCH}.tar.gz \
&& tar -xvzf kubo_v0.23.0_linux-${IPFS_ARCH}.tar.gz \
&& cd kubo \
&& bash install.sh \
&& cd .. \
&& rm -rf kubo kubo_v0.23.0_linux-${IPFS_ARCH}.tar.gz
# Copy project files
COPY . /app/
# Copy dependency checker for comprehensive dependency management
COPY scripts/utilities/dependency_checker.py /app/scripts/utilities/dependency_checker.py
# Install the package and its dependencies
RUN pip install --no-cache-dir -e .
# Run dependency checker to ensure all dependencies are installed
RUN python /app/scripts/utilities/dependency_checker.py --install-optional && echo "✅ All dependencies installed"
# Install optional dependencies based on the specified features
ARG FEATURES=all
RUN if [ "$FEATURES" = "all" ]; then \
pip install --no-cache-dir -e ".[all]"; \
elif [ "$FEATURES" = "vector" ]; then \
pip install --no-cache-dir -e ".[vector]"; \
elif [ "$FEATURES" = "graphrag" ]; then \
pip install --no-cache-dir -e ".[graphrag]"; \
elif [ "$FEATURES" = "webarchive" ]; then \
pip install --no-cache-dir -e ".[webarchive]"; \
elif [ "$FEATURES" = "distributed" ]; then \
pip install --no-cache-dir -e ".[distributed]"; \
elif [ "$FEATURES" = "minimal" ]; then \
pip install --no-cache-dir -e "."; \
fi
# Initialize IPFS (but don't start the daemon)
RUN ipfs init
# Set up the configuration directory
RUN mkdir -p /root/.ipfs_datasets \
&& cp /app/config/config.toml /root/.ipfs_datasets/config.toml
# Create volumes for data persistence
VOLUME ["/root/.ipfs", "/root/.ipfs_datasets", "/data"]
# Expose ports
# IPFS API and Gateway
EXPOSE 5001 8080
# libp2p ports
EXPOSE 4001/tcp 4001/udp
# Web service port
EXPOSE 8000
# Set up entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Default command (can be overridden)
CMD ["ipfs-datasets-server"]