-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.v1
More file actions
49 lines (42 loc) · 2.01 KB
/
Dockerfile.v1
File metadata and controls
49 lines (42 loc) · 2.01 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
ARG VERSION=8.3-cli-alpine
FROM public.ecr.aws/docker/library/php:${VERSION}
ARG PHPVERSION
ARG BASEOS
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
COPY extras/retry.sh /usr/local/bin/retry
RUN chmod +x /usr/local/bin/retry
# Install dependencies based on the base OS
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$BASEOS \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked,id=aptlists-$BASEOS \
if [ "$BASEOS" = "bookworm" ]; then \
echo 'deb http://deb.debian.org/debian bookworm main' > /etc/apt/sources.list && \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y --no-install-recommends curl git zip unzip ghostscript imagemagick optipng gifsicle pngcrush jpegoptim libjpeg-turbo-progs pngquant webp; \
elif [ "$BASEOS" = "alpine" ]; then \
apk update && \
apk add --no-cache curl git zip unzip ghostscript imagemagick optipng gifsicle pngcrush jpegoptim libjpeg-turbo libjpeg-turbo-utils pngquant libwebp-tools; \
fi
# Download and install PHP extensions with retry for transient failures
RUN retry 3 curl -sSLf -o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions && \
retry 3 install-php-extensions \
amqp bcmath bz2 calendar ctype exif intl imagick imap json mbstring ldap mcrypt memcached mongodb \
mysqli opcache pdo_mysql pdo_pgsql pgsql redis snmp soap sockets tidy timezonedb uuid vips xsl yaml zip zstd @composer
# Enable Apache rewrite mod, if applicable
RUN if command -v a2enmod; then a2enmod rewrite; fi
# Disable AV1 only in armv7
RUN case $(uname -m) in \
x86_64|aarch64) \
install-php-extensions gd; \
;; \
armv7l) \
IPE_GD_WITHOUTAVIF=1 install-php-extensions gd; \
;; \
*) \
;; \
esac
# Set working directory
WORKDIR /var/www/html