-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 847 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 847 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
35
36
37
38
39
# Chi Subnet Validator Docker Image
# Build: docker build -t chi-validator .
# Run: docker-compose up -d
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies first (better layer caching)
COPY pyproject.toml ./
# Install uv for faster dependency resolution
RUN pip install --no-cache-dir --upgrade pip uv
# Copy application code
COPY . .
# Install dependencies
RUN uv pip install --system --no-cache -e .
# Create non-root user for security
RUN useradd -m -u 1000 validator && \
chown -R validator:validator /app
# Environment configuration
ENV NETWORK=finney
ENV NETUID=1
ENV WALLET_NAME=validator
ENV HOTKEY_NAME=default
ENV LOG_LEVEL=INFO
# Run the validator
CMD ["python", "validator.py"]