-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (34 loc) · 1013 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM php:8.1-fpm
ARG WWW_USER=1000
ARG WWW_GROUP=100
# Set working directory
WORKDIR /var/www
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libpq-dev \
libzip-dev \
libcurl4-openssl-dev \
zip \
unzip
# Enable xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo pdo_pgsql pgsql mbstring exif pcntl bcmath gd zip curl intl
# Get latest Composer
RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
# Clean cache
RUN apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Create user
RUN groupadd --force -g $WWW_GROUP webapp
RUN useradd -ms /bin/bash --no-user-group -g $WWW_GROUP -u $WWW_USER webapp