Refactor Dockerfile and add linguist module
This commit refactors the Dockerfile to: - Reintroduce the programmer user creation with sudo privileges - Add necessary system dependencies for development tools - Update Go installation to include PATH in root's bashrc - Install github-linguist gem It also includes the addition of a new linguist command module with functions to interact with GitHub Linguist for language statistics and file information retrieval.
This commit is contained in:
83
Dockerfile
83
Dockerfile
@@ -1,83 +0,0 @@
|
||||
# Dockerfile
|
||||
FROM python:3.11-slim
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 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 \
|
||||
isort \
|
||||
logrotate
|
||||
|
||||
COPY tools tools
|
||||
|
||||
# Installer la dernière version de Go
|
||||
RUN bash tools/install_latest_go.sh
|
||||
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
|
||||
|
||||
# Installer le SDK MCP Python
|
||||
RUN pip install --no-cache-dir ruff fastmcp ipython
|
||||
|
||||
RUN curl -fsSL https://opencode.ai/install | bash \
|
||||
&& mv /root/.opencode/bin/opencode /usr/local/bin/
|
||||
|
||||
# Copier le serveur
|
||||
COPY src .
|
||||
|
||||
# Copier le script de démarrage
|
||||
COPY docker_startup.sh .
|
||||
COPY opencode.json ~/.config/opencode
|
||||
|
||||
# Exposer le port
|
||||
EXPOSE 7860
|
||||
ENV OLLAMA_ADDR="http://host.docker.internal:11434"
|
||||
|
||||
# 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"]
|
||||
Reference in New Issue
Block a user