Created
January 12, 2021 09:26
-
-
Save halimonalexander/6f197d092f4f2cd47b94a3b07595f49b 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 | |
USER root | |
# Arguments defined in docker-compose.yml | |
ARG user | |
ARG uid | |
ARG port | |
# Install dependencies | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
git \ | |
curl \ | |
libpng-dev \ | |
libonig-dev \ | |
libxml2-dev \ | |
libzip-dev \ | |
zip \ | |
unzip \ | |
# Clear cache | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
# Install extensions | |
&& docker-php-ext-install exif iconv mbstring pdo pdo_mysql pcntl zip \ | |
# Install composer | |
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ | |
# Add user for laravel application | |
&& groupadd -g $uid $user \ | |
&& useradd -u $uid -ms /bin/bash -g www $user | |
# Set working directory | |
WORKDIR /var/www | |
# Change current user to www | |
USER $user | |
# Expose port $port and start php-fpm server | |
EXPOSE $port | |
CMD ["php-fpm"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment