28 lines
1.2 KiB
Docker
28 lines
1.2 KiB
Docker
FROM php:8.1
|
|
|
|
ARG NODE_VER=20.11.1
|
|
SHELL ["/bin/bash", "-c"]
|
|
RUN curl https://nodejs.org/dist/v$NODE_VER/node-v$NODE_VER-linux-x64.tar.xz | tar --file=- --extract --xz --directory /usr/local/ --strip-components=1
|
|
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
|
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
|
RUN php composer-setup.php
|
|
RUN php -r "unlink('composer-setup.php');"
|
|
RUN mv composer.phar /usr/local/bin/composer
|
|
RUN apt-get update -yqq && apt-get install -yqq git zip unzip 7zip libzip-dev rsync && rm -rf /var/lib/apt/lists/*
|
|
RUN mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
|
|
#RUN docker-php-ext-install zip
|
|
|
|
ARG user=deployer
|
|
ARG group=deployer
|
|
ARG uid=1000
|
|
ARG gid=1000
|
|
RUN groupadd -g ${gid} ${group}
|
|
RUN useradd -u ${uid} -g ${group} -s /bin/sh -m ${user}
|
|
|
|
WORKDIR /home/deployer
|
|
RUN mkdir .ssh && touch .ssh/config
|
|
COPY known_hosts .ssh/known_hosts
|
|
RUN chmod 700 .ssh && chmod 600 .ssh/* && chown -R ${user}:${group} .ssh
|
|
|
|
USER ${uid}:${gid}
|
|
CMD /bin/bash
|