40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# Utiliser PHP 8.3 CLI
|
|
FROM php:8.3-cli
|
|
|
|
# Installer Git, unzip/zip et curl
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
unzip \
|
|
zip \
|
|
curl \
|
|
openssh-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Installer Composer 2
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
# Installer Node.js
|
|
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
|
|
RUN apt install -y nodejs
|
|
|
|
# Créer l'utilisateur jenkins avec home et bash
|
|
RUN useradd -m -s /bin/bash jenkins
|
|
|
|
# Créer le répertoire .ssh pour Jenkins
|
|
RUN mkdir -p /home/jenkins/.ssh \
|
|
&& chmod 700 /home/jenkins/.ssh
|
|
|
|
# Définir l'utilisateur jenkins pour la suite
|
|
USER jenkins
|
|
|
|
# Définir le répertoire de travail
|
|
WORKDIR /app
|
|
|
|
# Définir GIT_SSH_COMMAND pour tous les builds
|
|
ENV GIT_SSH_COMMAND="ssh -i /home/jenkins/.ssh/id_rsa -o StrictHostKeyChecking=no"
|
|
|
|
# Optionnel : copier un script d'entrée ou autres fichiers si nécessaire
|
|
# COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
# RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
# ENTRYPOINT ["entrypoint.sh"]
|