Created
May 20, 2023 10:57
-
-
Save DfKimera/42c394994e6829d4c1cf9c5655eca175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.4-fpm | |
# 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 \ | |
libcurl4-openssl-dev \ | |
zip \ | |
unzip \ | |
poppler-utils | |
# 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 mbstring json curl xml | |
# Install PECL extensions | |
RUN pecl install redis | |
RUN docker-php-ext-enable redis | |
# 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 | |
USER $user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment