-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (28 loc) · 1.09 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
# Dockerfile for Stockfish-Analyzer
# Provides a complete environment for running the chess analysis tool
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Install system dependencies including Stockfish
RUN apt-get update && apt-get install -y \
stockfish \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt
# Copy source code
COPY src/ ./src/
COPY config/ ./config/
# Create directory for Syzygy tablebases (optional)
RUN mkdir -p /app/syzygy
# Set environment variables
ENV PYTHONPATH=/app
ENV STOCKFISH_PATH=/usr/games/stockfish
# Create a non-root user for security
RUN useradd -m -u 1000 chessuser && chown -R chessuser:chessuser /app
USER chessuser
# Expose volumes for configuration and tablebases
VOLUME ["/app/config", "/app/syzygy"]
# Default command runs the application with example config
CMD ["python3", "src/main.py", "--config", "config/example_config.json"]