moment-1/docker/php/Dockerfile

48 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2024-08-23 12:02:48 +00:00
FROM php:fpm
WORKDIR /var/www
RUN apt-get --allow-releaseinfo-change update && apt-get upgrade -y \
&& apt-get install -y \
g++ \
libbz2-dev \
libc-client-dev \
libcurl4-gnutls-dev \
libedit-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libmcrypt-dev \
libpng-dev \
libsqlite3-dev \
libzip-dev \
wget \
unzip \
zlib1g-dev \
&& docker-php-ext-install -j$(nproc) \
mysqli \
pdo_mysql \
sockets \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip \
&& docker-php-source delete \
&& apt-get remove -y g++ wget \
&& apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/*
# Add user
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy existing application directory contents
COPY ./ /var/www
# Copy existing application directory permissions
COPY --chown=www:www ./ /var/www
# Change current user to www
USER www