-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
67 lines (53 loc) · 2.08 KB
/
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
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
FROM composer/composer:2.6.6-bin as composer-bin
FROM node:21.4.0-bullseye-slim as node
FROM php:8.3.1-fpm-bullseye
COPY --from=composer-bin ./composer /usr/bin/composer
ARG USER_NAME=host-user
ARG USER_ID=1000
ARG PHP_FPM_GROUP=www-data
RUN adduser \
--disabled-password \
--uid ${USER_ID} \
${USER_NAME} \
&& usermod \
--append \
--groups \
${PHP_FPM_GROUP} \
${USER_NAME}
#Add node and npm
COPY --from=node --chown=${USER_NAME}:root /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node --chown=${USER_NAME}:root /usr/local/bin/node /usr/local/bin/node
RUN ln --symbolic /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& chown --no-dereference ${USER_NAME}:root /usr/local/bin/npm \
&& ln --symbolic /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& chown --no-dereference ${USER_NAME}:root /usr/local/bin/npx
# Use the default development configuration
RUN mv "${PHP_INI_DIR}/php.ini-development" "${PHP_INI_DIR}/php.ini"
# For other versions check: http://nginx.org/packages/mainline/debian/pool/nginx/n/nginx/
ARG NGINX_VERSION="1.25.0-1~bullseye"
ARG PHPREDIS_VERSION=5.3.7
RUN apt-get update \
&& apt-get install --assume-yes gpg \
&& curl https://nginx.org/keys/nginx_signing.key | gpg --dearmour --output /etc/apt/trusted.gpg.d/apt.nginx.org.gpg > /dev/null \
&& echo "deb https://nginx.org/packages/mainline/debian bullseye nginx" | tee /etc/apt/sources.list.d/nginx.list \
&& apt-get update && apt-get install --assume-yes \
nginx=${NGINX_VERSION} \
libzip-dev \
libpq-dev \
supervisor \
cron \
&& pecl install redis-${PHPREDIS_VERSION} \
&& docker-php-ext-install \
zip \
pdo_pgsql \
&& docker-php-ext-enable \
redis
ARG XDEBUG_VERSION=3.2.1
ARG INSTALL_XDEBUG=true
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
pecl install xdebug-${XDEBUG_VERSION} \
&& docker-php-ext-enable xdebug \
;fi
COPY ./entrypoint.sh /entrypoint.sh
WORKDIR /application
ENTRYPOINT ["/entrypoint.sh"]