2020-04-09 22:06:58 +01:00
|
|
|
# Site Build
|
2020-04-09 22:12:27 +01:00
|
|
|
FROM node:lts-slim as build
|
2020-04-09 22:06:58 +01:00
|
|
|
|
|
|
|
ENV NODE_ENV production
|
|
|
|
|
2020-07-23 18:37:02 +01:00
|
|
|
ENV HUGO_VERSION=0.73.0
|
2020-04-09 22:06:58 +01:00
|
|
|
|
2020-04-09 22:23:27 +01:00
|
|
|
WORKDIR /app
|
2020-04-09 22:06:58 +01:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates
|
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
RUN npm ci --production
|
|
|
|
|
2020-04-11 23:45:38 +01:00
|
|
|
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb /tmp/hugo.deb
|
|
|
|
RUN dpkg -i /tmp/hugo.deb
|
|
|
|
|
2020-04-09 22:06:58 +01:00
|
|
|
RUN ./scripts/release.sh
|
|
|
|
|
|
|
|
# Production run
|
|
|
|
FROM nginx:stable-alpine
|
|
|
|
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
COPY --from=build /app/public/ /usr/share/nginx/html
|