-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (66 loc) · 2.17 KB
/
Dockerfile
File metadata and controls
75 lines (66 loc) · 2.17 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
65
66
67
68
69
70
71
72
73
74
75
ARG PHP_VERSION=8.3
ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS node
FROM composer:2 AS composer
FROM php:${PHP_VERSION}-cli-alpine
RUN apk add --no-cache \
bash git openssh-client unzip curl su-exec patch \
# Runtime libs (kept after build)
libzip libpng libjpeg-turbo freetype libwebp \
icu-libs gmp libldap libpq libxslt \
libffi tidyhtml gettext-libs \
imagemagick \
libstdc++ \
bzip2 \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
libzip-dev libpng-dev libjpeg-turbo-dev freetype-dev libwebp-dev \
icu-dev gmp-dev openldap-dev postgresql-dev libxslt-dev \
libffi-dev tidyhtml-dev imagemagick-dev \
bzip2-dev gettext-dev \
&& docker-php-ext-configure gd \
--with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j"$(nproc)" \
bcmath \
bz2 \
calendar \
exif \
ffi \
gd \
gettext \
gmp \
intl \
ldap \
mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
pgsql \
shmop \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
tidy \
xsl \
zip \
&& pecl install apcu redis imagick \
&& docker-php-ext-enable apcu redis imagick \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/cache/apk/* /usr/src/php/ext/*
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -sf /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -sf /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN git config --system --add safe.directory '*' \
&& git config --system user.email "artifact-builder@localhost" \
&& git config --system user.name "Artifact Builder"
ENV COMPOSER_CACHE_DIR=/tmp/composer-cache
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /app
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["sh"]