-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (51 loc) · 1.49 KB
/
Dockerfile
File metadata and controls
67 lines (51 loc) · 1.49 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
ARG BASE_IMAGE="python:3.11-slim-bullseye@sha256:7af2c2c559edb3388e5e86fb7d2a9b9b25ebb3851bcc86a9669d11cbc870c823"
# Base stage with common dependencies
FROM ${BASE_IMAGE} AS base
WORKDIR /
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install necessary packages and clean up
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get install -y --no-install-recommends \
curl \
build-essential \
gcc \
binutils \
pkg-config \
libsoup2.4-dev \
libjavascriptcoregtk-4.0-dev \
libpango1.0-dev \
libgtk-3-dev \
libwebkit2gtk-4.0-dev \
libssl-dev \
openssh-server \
net-tools \
bash \
ca-certificates \
sudo \
sqlite3 \
vim
RUN mkdir /var/run/sshd
# Install rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Cleanup
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
# Set the PATH to include cargo
ENV PATH="/root/.cargo/bin:${PATH}"
# Copy only requirements first for better caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY web/ web/
RUN pip install --no-cache-dir -r web/requirements.txt
RUN python web/readyai_conversation_data_importer.py
# Copy the rest of the application code
COPY . .
RUN pip install --no-cache-dir .
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Create the miners bittensor directory
RUN mkdir -p ~/.bittensor/miners
# Use the entrypoint script to decide which target to run
ENTRYPOINT ["/entrypoint.sh"]