summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-12 19:20:39 +0200
committermsquare <msquare@notrademark.de>2018-08-19 16:44:33 +0200
commit7c48b698063466943436e67a6b341e3a52013621 (patch)
treee3e0f1eafeb6641357869ff621209a541a8cf536
parentfd709f084e12fca62f212e589cdc7880bf4835ce (diff)
Docker: Fixed Dockerfile to build new setup
-rw-r--r--contrib/Dockerfile50
1 files changed, 27 insertions, 23 deletions
diff --git a/contrib/Dockerfile b/contrib/Dockerfile
index a45633f5..8d5fb47b 100644
--- a/contrib/Dockerfile
+++ b/contrib/Dockerfile
@@ -1,31 +1,35 @@
FROM composer AS composer
COPY composer.json /app/
-RUN composer install
-
+RUN composer install --no-dev
+RUN composer dump-autoload --optimize
FROM node:8-alpine as themes
WORKDIR /app
-RUN npm install -g less
-COPY --from=composer /app/vendor /app/vendor
-COPY public/ /app/public
-COPY themes/ /app/themes
-RUN sh /app/themes/build-themes.sh
+COPY frontend/ /app/frontend
+COPY .babelrc package.json webpack.config.js /app/
+RUN apk add --no-cache yarn
+RUN yarn install
+RUN yarn build
-FROM php:7-fpm-alpine
-RUN apk add --no-cache icu-dev
-RUN docker-php-ext-install intl
-RUN apk add --no-cache gettext-dev
-RUN docker-php-ext-install gettext
-RUN docker-php-ext-install pdo_mysql
+# Intermediate container for less layers
+FROM alpine as data
+COPY config/ /app/config
+COPY db/ /app/db
+COPY includes/ /app/includes
+COPY locale/ /app/locale
+COPY public/ /app/html
+COPY src/ /app/src
+COPY templates/ /app/templates
+
+COPY --from=composer /app/vendor/ /app/vendor
+COPY --from=composer /app/composer.lock /app/
-COPY --from=composer /app/vendor /var/www/vendor
-COPY --from=themes /app/public/ /var/www/html
-COPY src/ /var/www/src/
-COPY includes/ /var/www/includes/
-COPY config/ /var/www/config/
-COPY locale/ /var/www/locale
-COPY templates/ /var/www/templates
+COPY --from=themes /app/public/assets /app/html/assets
+COPY --from=themes /app/yarn.lock /app/
-# Symlink gets copied so we delete the symlink.
-RUN rm /var/www/html/vendor/bootstrap
-COPY vendor/twbs/bootstrap/dist/ /var/www/html/vendor/bootstrap/
+RUN rm -f /app/config/config.php
+
+FROM php:7-fpm-alpine
+COPY --from=data /app/ /var/www
+RUN apk add --no-cache icu-dev gettext-dev && \
+ docker-php-ext-install intl gettext pdo_mysql