2026-01-25 12:07:21 +01:00
|
|
|
# Dockerfile
|
|
|
|
|
FROM python:3.11-slim
|
|
|
|
|
|
2026-01-25 17:24:46 +01:00
|
|
|
# Ajouter le dépôt Debian Testing pour les paquets plus récents
|
|
|
|
|
RUN echo "deb http://deb.debian.org/debian testing main" \
|
|
|
|
|
> /etc/apt/sources.list.d/testing.list
|
|
|
|
|
|
2026-01-25 12:07:21 +01:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-01-25 17:24:46 +01:00
|
|
|
# Installer les outils de développement Go et Rust
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
|
apt-get install -y \
|
|
|
|
|
clang \
|
|
|
|
|
llvm-dev \
|
|
|
|
|
libclang-dev \
|
|
|
|
|
pkg-config \
|
|
|
|
|
build-essential \
|
|
|
|
|
git \
|
|
|
|
|
make \
|
|
|
|
|
curl \
|
|
|
|
|
nodejs \
|
|
|
|
|
npm \
|
|
|
|
|
pylint \
|
|
|
|
|
black \
|
|
|
|
|
flake8 \
|
|
|
|
|
mypy \
|
2026-01-28 16:56:35 +01:00
|
|
|
isort \
|
2026-02-21 11:41:21 +01:00
|
|
|
logrotate \
|
|
|
|
|
sudo \
|
|
|
|
|
cmake \
|
|
|
|
|
libicu-dev \
|
|
|
|
|
zlib1g-dev \
|
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
|
libssl-dev \
|
|
|
|
|
ruby-dev \
|
|
|
|
|
jq
|
2026-01-25 17:24:46 +01:00
|
|
|
|
|
|
|
|
COPY tools tools
|
|
|
|
|
|
2026-02-21 11:41:21 +01:00
|
|
|
# Création d'un utilisateur programmeur avec UID 1000 et home dans /home/programmer
|
|
|
|
|
RUN useradd -u 1000 -m -d /home/programmer -s /bin/bash programmer && \
|
|
|
|
|
echo "programmer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/programmer
|
|
|
|
|
|
2026-01-25 17:24:46 +01:00
|
|
|
# Installer la dernière version de Go
|
2026-02-21 11:41:21 +01:00
|
|
|
RUN bash tools/install_latest_go.sh && \
|
|
|
|
|
echo "PATH=/usr/local/go/bin:$PATH" >> /root/.bashrc
|
2026-01-25 17:24:46 +01:00
|
|
|
ENV PATH=/usr/local/go/bin:$PATH
|
|
|
|
|
|
|
|
|
|
# Installer la dernière version de Rust
|
|
|
|
|
ENV RUSTUP_HOME=/usr/local/rustup
|
|
|
|
|
ENV CARGO_HOME=/usr/local/cargo
|
|
|
|
|
ENV PATH=/usr/local/cargo/bin:$PATH
|
|
|
|
|
RUN curl https://sh.rustup.rs -sSf \
|
|
|
|
|
| sh -s -- -y --default-toolchain stable \
|
|
|
|
|
&& rustup install nightly \
|
|
|
|
|
&& rustup component add rustfmt clippy rust-src rust-docs \
|
|
|
|
|
&& cargo install cargo-edit cargo-watch cargo-outdated cargo-make cargo-binstall
|
|
|
|
|
|
|
|
|
|
# Installer la dernière version de typscript
|
|
|
|
|
RUN npm install -g typescript tsc @types/node eslint prettier
|
|
|
|
|
|
|
|
|
|
RUN cargo binstall --strategies crate-meta-data jj-cli
|
|
|
|
|
|
2026-02-21 11:41:21 +01:00
|
|
|
RUN gem install github-linguist
|
|
|
|
|
|
2026-01-25 12:07:21 +01:00
|
|
|
# Installer le SDK MCP Python
|
2026-01-25 17:24:46 +01:00
|
|
|
RUN pip install --no-cache-dir ruff fastmcp ipython
|
2026-01-25 12:07:21 +01:00
|
|
|
|
2026-01-28 16:56:35 +01:00
|
|
|
RUN curl -fsSL https://opencode.ai/install | bash \
|
|
|
|
|
&& mv /root/.opencode/bin/opencode /usr/local/bin/
|
|
|
|
|
|
2026-01-25 12:07:21 +01:00
|
|
|
# Copier le serveur
|
2026-01-25 17:24:46 +01:00
|
|
|
COPY src .
|
2026-01-25 12:07:21 +01:00
|
|
|
|
2026-01-28 16:56:35 +01:00
|
|
|
# Copier le script de démarrage
|
|
|
|
|
COPY docker_startup.sh .
|
|
|
|
|
COPY opencode.json ~/.config/opencode
|
|
|
|
|
|
2026-01-25 12:07:21 +01:00
|
|
|
# Exposer le port
|
2026-01-28 16:56:35 +01:00
|
|
|
EXPOSE 7860
|
2026-01-25 17:24:46 +01:00
|
|
|
ENV OLLAMA_ADDR="http://host.docker.internal:11434"
|
2026-01-25 12:07:21 +01:00
|
|
|
|
2026-01-28 16:56:35 +01:00
|
|
|
# Rendre le script exécutable et lancer le serveur
|
|
|
|
|
RUN chmod +x docker_startup.sh
|
|
|
|
|
RUN mkdir /sandbox /log \
|
|
|
|
|
&& chown programmer:programmer /sandbox /log
|
|
|
|
|
|
|
|
|
|
# Création de la configuration logrotate
|
|
|
|
|
COPY logrotate-config /etc/logrotate.d/mcp-logs
|
|
|
|
|
|
|
|
|
|
# Changer l'utilisateur pour programmeur
|
|
|
|
|
USER programmer
|
|
|
|
|
RUN mkdir -p /home/programmer/.config/opencode
|
|
|
|
|
COPY opencode.json /home/programmer/.config/opencode
|
|
|
|
|
CMD ["./docker_startup.sh"]
|