diff --git a/.drone.yml b/.drone.yml index e9d8790..c93978d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -53,6 +53,9 @@ steps: repo: ocram85/blog tags: "next" dockerfile: Dockerfile + build_args: + - NODE_BASE=lts-buster-slim + - NGINX_BASE=1.21.6-alpine - name: "Trivy (next)" image: aquasec/trivy @@ -111,6 +114,9 @@ steps: repo: ocram85/blog auto_tag: true dockerfile: Dockerfile + build_args: + - NODE_BASE=lts-buster-slim + - NGINX_BASE=1.21.6-alpine - name: "Trivy (latest)" image: aquasec/trivy diff --git a/Dockerfile b/Dockerfile index dd35ad9..ec0d09b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ -FROM node:lts-buster-slim as builder +# Build ARGS for base image versions +ARG NODE_BASE=lts-buster-slim +ARG NGINX_BASE=1.21.6-alpine + +FROM node:${NODE_BASE} as builder COPY . /src #RUN ls -la WORKDIR /src @@ -6,7 +10,7 @@ WORKDIR /src RUN npm install \ && npm run build -FROM nginx:1.21.6-alpine as prod +FROM nginx:${NGINX_BASE} as prod LABEL maintainer="marco.blessing@googlemail.com" HEALTHCHECK --interval=15s --timeout=5s \ CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1