deploycontainer/Dockerfile

29 lines
1.2 KiB
Text
Raw Permalink Normal View History

2024-03-26 21:38:29 +00:00
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
2024-03-28 01:49:39 +00:00
RUN apt-get update -yqq && apt-get install -yqq git zip unzip 7zip libzip-dev rsync && rm -rf /var/lib/apt/lists/*
2024-03-26 21:38:29 +00:00
RUN mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
2024-03-28 01:49:39 +00:00
#RUN docker-php-ext-install zip
2024-03-26 21:38:29 +00:00
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}
2024-03-28 01:49:39 +00:00
WORKDIR /home/deployer
2024-03-28 01:49:39 +00:00
RUN mkdir .ssh && touch .ssh/config
COPY known_hosts .ssh/known_hosts
RUN chmod 700 .ssh && chmod 600 .ssh/* && chown -R ${user}:${group} .ssh
2024-03-26 21:38:29 +00:00
2024-03-28 01:49:39 +00:00
USER ${uid}:${gid}
2024-03-26 21:38:29 +00:00
CMD /bin/bash