28 lines
556 B
Docker
28 lines
556 B
Docker
# Site Build
|
|
FROM node:lts-slim as build
|
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV HUGO_VERSION=0.68.3
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates
|
|
|
|
COPY . /app
|
|
|
|
RUN npm ci --production
|
|
|
|
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
|
|
|
|
RUN ./scripts/release.sh
|
|
|
|
# Production run
|
|
FROM nginx:stable-alpine
|
|
|
|
RUN rm /var/log/nginx/access.log
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
COPY --from=build /app/public/ /usr/share/nginx/html
|