-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
92 lines (76 loc) · 2.75 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM php:7.2-fpm-alpine
ARG php_display_errors=On
ARG php_opcache_enabled=On
ARG PHP_XDEBUG_IDE_KEY
ENV PHP_XDEBUG_IDE_KEY=$PHP_XDEBUG_IDE_KEY
ARG PHP_XDEBUG_PORT
ENV PHP_XDEBUG_PORT=$PHP_XDEBUG_PORT
ARG PHP_XDEBUG_REMOTE_HOST
ENV PHP_XDEBUG_REMOTE_HOST=$PHP_XDEBUG_REMOTE_HOST
ARG PHP_XDEBUG_IDE_ENABLED
ENV PHP_XDEBUG_IDE_ENABLED=$PHP_XDEBUG_IDE_ENABLED
RUN set -xe \
&& apk update \
&& apk --no-cache add \
bash \
libpq \
icu-dev \
libzip-dev \
postgresql-dev \
make \
git \
openssh \
ca-certificates \
nodejs \
npm && \
npm install -g bower
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
RUN if [ $PHP_XDEBUG_IDE_ENABLED = 1 ] ; then \
apk add --no-cache ${PHPIZE_DEPS} \
&& pecl install xdebug-2.9.8 \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.idekey=$PHP_XDEBUG_IDE_KEY" >> "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_port=$PHP_XDEBUG_PORT" >> "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_enable=1" >> "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_autostart=1" >> "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_connect_back=0" >> "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_host=$PHP_XDEBUG_REMOTE_HOST" >> "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini"; \
fi
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 && sync && \
install-php-extensions \
intl \
zip \
http \
memcache \
memcached \
pdo_mysql \
pdo_pgsql
COPY docker-php-source /usr/local/bin/
# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598)
RUN docker-php-ext-enable sodium
# COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
# RUN docker-php-ext-enable opcache
#install COMPOSER
COPY --from=composer:1.10 /usr/bin/composer /usr/bin/composer
RUN composer --version
ENV COMPOSER_ALLOW_SUPERUSER 1
# fix timezone
ENV TIMEZONE America/Sao_Paulo
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/timezone
RUN echo "date.timezone=${TIMEZONE}" > "$PHP_INI_DIR/conf.d/00-docker-php-date-timezone.ini"
# COPY $PWD/docker/php/entrypoint.sh /
# RUN chmod +x /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]
# RUN mkdir /app \
# && chown 1000:1000 /app \
# && touch /tmp/xdebug.log \
# && chown 1000:1000 /tmp/xdebug.log
ENTRYPOINT ["docker-php-entrypoint"]
WORKDIR /var/www/html
EXPOSE 9000
# WORKDIR /app
CMD ["php-fpm"]