-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphp74.Dockerfile
More file actions
64 lines (55 loc) · 1.3 KB
/
php74.Dockerfile
File metadata and controls
64 lines (55 loc) · 1.3 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# PHP + Apache
FROM php:7.4-apache
LABEL maintainer="inderjeet@gmail.com"
# Define user for the container
ENV user=docker
ENV uid=1000
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libmcrypt-dev \
libmemcached-dev \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
zip \
unzip \
wget \
vim \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install \
bcmath \
calendar \
exif \
gd \
intl \
mysqli \
opcache \
pcntl \
pdo_mysql \
soap \
zip \
sockets
# Install PHP extensions using PECL
RUN pecl install redis-5.3.2 \
&& pecl install xdebug-2.9.8 \
&& pecl install mcrypt-1.0.3 \
&& pecl install memcached-3.1.5 \
&& pecl install grpc-1.32.0 \
&& docker-php-ext-enable redis \
xdebug mcrypt memcached grpc
# Enable common Apache modules
RUN a2enmod headers expires rewrite ssl
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
# Create system user to run Composer and Other 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
# Set current user
# USER $user