-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (36 loc) · 1.45 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
ARG PHP_VERSION="8.4"
ARG COMPOSER_VERSION=2
FROM composer:${COMPOSER_VERSION} AS composer
FROM php:${PHP_VERSION}-fpm-alpine AS php
LABEL maintainer="[email protected]"
ARG PHP_EXTENSIONS
ARG APP_CODE_PATH="."
ARG APP_CODE_PATH_CONTAINER="/webdata"
ENV APP_CODE_PATH_CONTAINER=$APP_CODE_PATH_CONTAINER
ENV XDEBUG_CLIENT_HOST=172.17.0.1
ENV XDEBUG_IDE_KEY=myide
ENV PHP_IDE_CONFIG="serverName=${XDEBUG_IDE_KEY}"
ENV PATH="/root/.composer/vendor/bin:$PATH"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN apk add --no-cache tini zip fcgi vim git openssh curl
# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions ${PHP_EXTENSIONS}
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer global require laravel/installer
# PHP-FPM config
COPY php/fpm.conf /usr/local/etc/php-fpm.d/
# Scripts & Healthchecks
COPY php/scripts/entrypoint /usr/local/bin/
COPY php/scripts/php-fpm-healthcheck /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint /usr/local/bin/php-fpm-healthcheck
# Use dev php.ini
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY php/dev-* $PHP_INI_DIR/conf.d/
# Set working directory now that ENV is set
WORKDIR ${APP_CODE_PATH_CONTAINER}
RUN php-fpm -t
HEALTHCHECK CMD ["php-fpm-healthcheck"]
ENTRYPOINT ["entrypoint"]
CMD ["php-fpm"]