1- FROM php:7.1-apache
1+ FROM node:10-buster-slim as builder
2+ LABEL author=
"Devin Matte <[email protected] >" 3+
4+ WORKDIR /usr/src/schedule
5+ COPY package.json ./
6+
7+ RUN npm install --silent
8+
9+ COPY package.json tsconfig.json gulpfile.js ./
10+ COPY assets ./assets
11+ RUN npm run-script build
12+
13+
14+ FROM php:7.1-apache as php-setup
215LABEL author=
"Devin Matte <[email protected] >" 316
417RUN echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list
@@ -21,6 +34,7 @@ RUN apt-get -yq update && \
2134 libjpeg-dev \
2235 libfreetype6-dev \
2336 libxml2-dev \
37+ unzip \
2438 wget \
2539 --no-install-recommends
2640
@@ -40,22 +54,18 @@ RUN docker-php-ext-install mysqli && \
4054
4155RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
4256
57+
58+ FROM php-setup
59+ LABEL author=
"Devin Matte <[email protected] >" 60+
4361COPY apache-config.conf /etc/apache2/sites-enabled/000-default.conf
4462
4563RUN a2enmod rewrite && a2enmod headers && a2enmod expires && \
4664 sed -i '/Listen/{s/\( [0-9]\+\) /8080/; :a;n; ba}' /etc/apache2/ports.conf && \
4765 chmod og+rwx /var/lock/apache2 && chmod -R og+rwx /var/run/apache2
4866
4967COPY . /var/www/html
50-
51- RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
52- && apt-get -yq update \
53- && apt-get -yq install nodejs --no-install-recommends \
54- && npm install \
55- && npm run-script build \
56- && apt-get -yq remove nodejs \
57- && apt-get -yq clean all \
58- && rm -rf node_modules
68+ COPY --from=builder /usr/src/schedule/assets/prod /var/www/html/assets/prod
5969
6070RUN composer install
6171
0 commit comments