Docker: Fixed Dockerfile to build new setup

main
Igor Scheller 6 years ago committed by msquare
parent fd709f084e
commit 7c48b69806

@ -1,31 +1,35 @@
FROM composer AS composer FROM composer AS composer
COPY composer.json /app/ COPY composer.json /app/
RUN composer install RUN composer install --no-dev
RUN composer dump-autoload --optimize
FROM node:8-alpine as themes FROM node:8-alpine as themes
WORKDIR /app WORKDIR /app
RUN npm install -g less COPY frontend/ /app/frontend
COPY --from=composer /app/vendor /app/vendor COPY .babelrc package.json webpack.config.js /app/
COPY public/ /app/public RUN apk add --no-cache yarn
COPY themes/ /app/themes RUN yarn install
RUN sh /app/themes/build-themes.sh RUN yarn build
FROM php:7-fpm-alpine # Intermediate container for less layers
RUN apk add --no-cache icu-dev FROM alpine as data
RUN docker-php-ext-install intl COPY config/ /app/config
RUN apk add --no-cache gettext-dev COPY db/ /app/db
RUN docker-php-ext-install gettext COPY includes/ /app/includes
RUN docker-php-ext-install pdo_mysql 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/assets /app/html/assets
COPY --from=themes /app/public/ /var/www/html COPY --from=themes /app/yarn.lock /app/
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
# Symlink gets copied so we delete the symlink. RUN rm -f /app/config/config.php
RUN rm /var/www/html/vendor/bootstrap
COPY vendor/twbs/bootstrap/dist/ /var/www/html/vendor/bootstrap/ 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

Loading…
Cancel
Save