FROM alpine:3.18

RUN apk update && apk add --no-cache\
    bash \
    wget  \
    curl  \
    nano \
    unzip \
    libzip-dev \
    libxml2 \
    libxml2-dev \
    git \
    zlib-dev \
    libpng-dev \
    php81 \
    php81-common \
    php81-fpm \
    php81-pdo \
    php81-opcache \
    php81-soap \
    php81-zip \
    php81-phar \
    php81-iconv \
    php81-cli \
    php81-curl \
    php81-openssl \
    php81-mbstring \
    php81-tokenizer \
    php81-fileinfo \
    php81-json \
    php81-xml \
    php81-xmlwriter \
    php81-xmlreader \
    php81-simplexml \
    php81-dom \
    php81-pdo_mysql \
    php81-pdo_pgsql \
    php81-pdo_sqlite \
    php81-tokenizer \
    php81-pecl-redis \
    php81-gd

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

ENV COMPOSER_ALLOW_SUPERUSER=1

ARG MOUNT_PATH

COPY . /var/www/app

WORKDIR /var/www/app

CMD composer install;\
    php artisan key:generate;\
#    php artisan migrate ;\
#    php artisan db:seed;\
#    php artisan storege:link;\
    php artisan serve --host=0.0.0.0