oliverdavies.uk-drupal-old/Dockerfile

65 lines
1.5 KiB
Docker
Raw Normal View History

FROM node:14-alpine AS assets
WORKDIR /app
RUN mkdir /node_modules \
chown node:node -R /node_modules /app
USER node
2021-05-09 20:01:32 +00:00
WORKDIR /app/web/themes/custom/opdavies
COPY web/themes/custom/opdavies/.yarnrc .
COPY web/themes/custom/opdavies/package.json .
COPY web/themes/custom/opdavies/yarn.lock .
RUN yarn install && yarn cache clear
2021-05-09 20:01:32 +00:00
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 /app/web/themes/custom/opdavies/build build
2021-05-09 20:01:32 +00:00
###
FROM php:7.4-fpm-buster AS base
2021-02-09 12:00:00 +00:00
2021-12-03 08:48:09 +00:00
RUN apt-get update -yqq && \
apt-get install -yqq --no-install-recommends \
2021-02-09 12:00:00 +00:00
libpng-dev \
mariadb-client \
2021-12-17 15:12:04 +00:00
unzip \
2021-02-09 12:00:00 +00:00
zlib1g-dev \
&& docker-php-ext-install \
exif \
gd \
2021-12-03 08:48:09 +00:00
pdo_mysql \
&& rm -fr /var/lib/apt/lists/*
2021-02-09 12:00:00 +00:00
###
FROM base AS dev
2021-04-21 12:36:43 +00:00
ARG xdebug_version=2.9.0
2021-12-03 08:48:09 +00:00
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
2021-04-21 16:06:10 +00:00
git \
2021-02-09 12:00:00 +00:00
pv \
vim \
2021-04-21 16:06:10 +00:00
zip \
2021-04-21 12:36:43 +00:00
&& pecl install xdebug-${xdebug_version} \
2021-12-03 08:48:09 +00:00
&& docker-php-ext-enable xdebug \
&& rm -fr /var/lib/apt/lists/*
2021-02-09 12:00:00 +00:00
2021-04-21 12:38:00 +00:00
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
2021-05-09 20:01:32 +00:00
COPY tools/docker/images/php/configs/php.ini /usr/local/etc/php/conf.d/php.ini
2021-02-09 12:00:00 +00:00
2021-04-21 12:42:27 +00:00
WORKDIR /app
ENV PATH="$PATH:/app/bin"
2021-04-21 12:42:27 +00:00
2021-02-09 12:00:00 +00:00
COPY composer.json composer.lock /app/
COPY assets /app/assets
COPY tools/patches /app/tools/patches
2021-02-09 12:00:00 +00:00
RUN composer install