generated from cnizzardini/cakephp-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (37 loc) · 1.2 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
#
# container
# @see https://hub.docker.com/repository/docker/cnizzardini/php-fpm-alpine
# @see https://github.com/cnizzardini/php-fpm-alpine/tree/php-7.4
FROM cnizzardini/php-fpm-alpine:7.4-latest AS cakephp_php
ARG ENV=prod
ARG UID=1000
ENV APP_ENV=$ENV
#
# dev/test depdencies
#
RUN if [[ "$ENV" != "prod" ]]; then \
apk add git \
&& apk add --no-cache --virtual .php-deps file re2c autoconf make zlib zlib-dev g++ curl \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del -f .php-deps; \
fi
#
# application
#
COPY .docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
COPY .docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
COPY .assets /srv/.assets
WORKDIR /srv/app
RUN addgroup -g 101 nginx
RUN adduser --disabled-password --gecos '' -u $UID cakephp;
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY app .
RUN if [[ "$ENV" = "prod" ]]; then \
composer install --prefer-dist --no-interaction --no-dev; \
fi
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]