This repository has been archived by the owner on Nov 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
92 lines (66 loc) · 1.6 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 node:10.15.3-slim AS node
#
# Stage: NPM install
#
FROM node AS npm
WORKDIR /app
COPY package.json \
package-lock.json \
./
RUN npm install
#
# Stage: Compile assets using Gulp
#
FROM node AS gulp
WORKDIR /app
RUN apt-get update && apt-get install --yes --no-install-recommends \
python3-pip \
&& pip3 --no-cache-dir install \
brotli \
fonttools \
&& rm -rf /var/lib/apt/lists/*
COPY .babelrc \
.browserslistrc \
.eslintrc.js \
.stylelintrc \
gulpfile.babel.js \
jest.config.js \
webpack.config.babel.js \
./
COPY --from=npm /app/node_modules/ node_modules/
COPY test/ test/
COPY source/ source/
RUN npx gulp build
#
# Stage: Composer install
#
FROM composer:1.7.3 AS composer
COPY core/ core/
COPY config/ config/
COPY composer.json \
composer.lock \
./
RUN composer --no-interaction install --ignore-platform-reqs --classmap-authoritative --no-suggest --prefer-dist
#
# Stage: Generate pattern library
#
FROM php:7.2.12-cli-alpine AS build
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
pecl install inotify && \
docker-php-ext-enable inotify && \
rm -rf /tmp/pear/ && \
apk del .build-deps
WORKDIR /app
COPY core/ core/
COPY config/ config/
COPY --from=composer /app/vendor/ vendor/
COPY --from=gulp /app/build/source/ build/source/
RUN core/console --generate
#
# Stage: Serve pattern library
#
FROM nginx:1.15.7-alpine AS ui
COPY --from=build /app/build/public/ /usr/share/nginx/html/
HEALTHCHECK --interval=5s CMD nc -z localhost 80
ARG revision
LABEL org.opencontainers.image.revision=${revision}