Updated files for docker

This commit is contained in:
2022-04-19 18:08:07 +02:00
parent f0fae39614
commit cfffdcd980
5 changed files with 50 additions and 17 deletions

View File

@@ -0,0 +1,25 @@
FROM php:8.0-fpm
ARG USER_UID
ARG USER_NAME
ENV COMPOSER_HOME=/home/$USER_NAME/.composer
RUN useradd -G www-data,root -u $USER_UID -d /home/$USER_NAME $USER_NAME
RUN mkdir -p /home/$USER_NAME/.composer && \
chown $USER_NAME:$USER_NAME -R /home/$USER_NAME
RUN set -eux \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install git zip unzip -y
RUN curl -sS https://getcomposer.org/installer \
| php -- --version=2.3.5 --install-dir=/usr/local/bin --filename=composer
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN set -eux \
&& apt-get install nodejs -y
RUN npm install --global npm@latest
COPY ./install.sh /usr/local/bin/install
USER $USER_UID
EXPOSE 9000

View File

@@ -0,0 +1,20 @@
#!/bin/sh
if [ ! -d "vendor" ] && [ -f "composer.json" ]; then
echo ""
echo "########################################"
echo "# vendor directory not found... #"
echo "########################################"
composer install
fi
if [ ! -d "node_modules" ] && [ -f "package.json" ]; then
echo ""
echo "########################################"
echo "# node_modules directory not found... #"
echo "########################################"
npm install
npm run dev
fi
exec "$@"