added files

This commit is contained in:
2022-11-15 11:51:25 +01:00
parent 5851ed822d
commit 7ad81f767e
2 changed files with 87 additions and 0 deletions

41
php/Dockerfile Normal file
View File

@@ -0,0 +1,41 @@
FROM php:8.1-fpm AS phpbase
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Set working directory
WORKDIR /var/www/html
USER $user
COPY ./WebsiteAPI /var/www/html/
RUN composer install
RUN composer update
CMD ["php","artisan","serve","--port=9000","--host=0.0.0.0"]