-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
118 lines (99 loc) · 2.88 KB
/
Dockerfile
File metadata and controls
118 lines (99 loc) · 2.88 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Living-LLM: Revolutionary AI Architecture Docker Image
FROM nvidia/cuda:11.8-devel-ubuntu20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-dev \
git \
curl \
wget \
unzip \
build-essential \
cmake \
pkg-config \
libssl-dev \
libffi-dev \
libjpeg-dev \
libpng-dev \
libavformat-dev \
libavcodec-dev \
libswscale-dev \
libgtk-3-dev \
libcanberra-gtk-module \
libcanberra-gtk3-module \
libnss3-dev \
libxss1 \
libgconf-2-4 \
libxrandr2 \
libasound2-dev \
libpangocairo-1.0-0 \
libatk1.0-0 \
libcairo-gobject2 \
libgtk-3-0 \
libgdk-pixbuf2.0-0 \
chromium-browser \
chromium-chromedriver \
redis-tools \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Create symbolic link for python
RUN ln -s /usr/bin/python3 /usr/bin/python
# Upgrade pip
RUN python -m pip install --upgrade pip setuptools wheel
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Download spaCy model
RUN python -m spacy download en_core_web_sm
# Install additional ML libraries
RUN pip install --no-cache-dir \
flash-attn==2.0.4 \
xformers==0.0.20 \
bitsandbytes==0.41.0 \
triton==2.0.0
# Create necessary directories
RUN mkdir -p /app/data /app/models /app/logs /app/checkpoints /app/evolution_checkpoints /app/configs
# Copy application code
COPY . .
# Set proper permissions
RUN chmod +x /app/main.py
RUN chmod +x /app/.github/scripts/*.py
# Create non-root user for security
RUN useradd -m -u 1000 living-llm && \
chown -R living-llm:living-llm /app
USER living-llm
# Set Chrome/Chromium path for Selenium
ENV CHROME_BIN=/usr/bin/chromium-browser
ENV CHROME_PATH=/usr/bin/chromium-browser
# Expose ports
EXPOSE 8000 8001
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/api/status || exit 1
# Default command
CMD ["python", "main.py", "--mode", "full"]
# Build arguments for versioning
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
# Labels for metadata
LABEL \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Living-LLM" \
org.label-schema.description="Revolutionary 1B Parameter Language Model That Evolves, Learns, and Adapts" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/your-username/Living-LLM" \
org.label-schema.vendor="Living-LLM Team" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
maintainer="living-llm-team@example.com"