oliverdavies.uk-drupal-old/tools/docker/Dockerfile
Oliver Davies 80566ee8ea fix: spacing on blog and talks pages
Ensure that the `config` directory is included when generating the
assets so that they can be scanned and used when determining which
classes from Tailwind to generate.
2021-12-18 01:24:53 +00:00

80 lines
1.8 KiB
Docker

FROM node:14-alpine AS assets-build
WORKDIR /app/web/themes/custom/opdavies
COPY web/themes/custom/opdavies/package*.json ./
RUN npm ci
COPY web/themes/custom/opdavies ./
RUN npm run production
###
FROM nginx:1-alpine AS nginx
COPY tools/docker/images/nginx/configs/vhost.conf /etc/nginx/conf.d/default.conf
WORKDIR /app
COPY web web/
WORKDIR /app/web/themes/custom/opdavies
COPY --from=assets-build /app/web/themes/custom/opdavies/build build
###
FROM php:7.4-fpm-buster AS base
RUN apt-get update -yqq && \
apt-get install -yqq --no-install-recommends \
libpng-dev \
mariadb-client \
unzip \
zlib1g-dev \
&& docker-php-ext-install \
exif \
gd \
pdo_mysql \
&& rm -fr /var/lib/apt/lists/*
###
FROM base AS dev
ARG xdebug_version=2.9.0
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
git \
pv \
vim \
zip \
&& pecl install xdebug-${xdebug_version} \
&& docker-php-ext-enable xdebug \
&& rm -fr /var/lib/apt/lists/*
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY tools/docker/images/php/configs/php.ini /usr/local/etc/php/conf.d/php.ini
WORKDIR /app
ENV PATH="$PATH:/app/bin"
COPY composer.json composer.lock /app/
COPY assets /app/assets
COPY tools/patches /app/tools/patches
RUN composer install
###
FROM node:14-alpine AS assets
WORKDIR /node
COPY web/themes/custom/opdavies/package*.json ./
RUN npm install
COPY config config
COPY web/themes/custom/opdavies/postcss.config.js .
COPY web/themes/custom/opdavies/webpack.config.js .
COPY web/themes/custom/opdavies/tailwind.config.js .
COPY web/themes/custom/opdavies/tailwindcss tailwindcss
COPY web/themes/custom/opdavies/assets assets
COPY web/themes/custom/opdavies/templates templates
RUN npm run prod \
&& rm -fr node_modules