This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (45 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
FROM php:7.2.6-fpm-alpine3.7
ARG ALPINE_SERVER=""
ARG NPM_PROXY=""
ARG COMPOSER_URL
ARG COMPOSER_HASH=""
WORKDIR /app
COPY composer.* ./
COPY package* ./
COPY webpack.config.js ./
COPY src/js ./src/js
COPY src/css ./src/css
COPY public/ ./public
RUN set -eux \
&& if [[ -n "${ALPINE_SERVER}" ]]; then \
sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_SERVER}/" /etc/apk/repositories; \
fi \
&& apk add --no-cache nodejs-npm \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& docker-php-ext-install pdo_mysql \
&& wget -O /usr/local/bin/composer.phar ${COMPOSER_URL} \
&& chmod +x /usr/local/bin/composer.phar \
&& if [[ -n "${COMPOSER_HASH}" ]]; then \
echo "${COMPOSER_HASH} /usr/local/bin/composer.phar" > /tmp/hash; \
sha256sum -c /tmp/hash; \
fi \
&& composer.phar install --no-dev \
&& if [[ -n "${NPM_PROXY}" ]]; then \
npm config set proxy $NPM_PROXY; \
npm config set https-proxy $NPM_PROXY; \
npm config set strict-ssl false; \
fi \
&& npm install \
&& npm run webpack \
&& rm -rf node_modules \
&& apk del .build-deps \
&& mkdir logs
COPY src/ ./src
COPY tests/ ./tests
COPY .php_cs.dist ./
COPY phpunit.xml ./
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
CMD ["php-fpm"]