From 695812126ae9d915cc1b74b3275c26d4c0895b83 Mon Sep 17 00:00:00 2001 From: David Noyes Date: Thu, 14 Mar 2024 15:42:01 +0000 Subject: [PATCH] Docker testing and validation Signed-off-by: David Noyes --- Dockerfile | 16 ++++++++++++++++ Makefile | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..5d32cd4a82f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:21 + +RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app + +WORKDIR /home/node/app + +RUN npm install -g netlify-cli + +USER node + +COPY --chown=node:node package*.json ./ + +RUN npm install + +EXPOSE 8888 +EXPOSE 3000 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..93e8077ffd7 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +.PHONY: docker-build +docker-build: + @docker build --tag test-cert-manager.io . + +.PHONY: docker-rm +docker-rm: + @docker rm -f test-cert-manager.io + @docker rm -f verify-cert-manager.io + +.PHONY: docker-clean +docker-clean: docker-rm + @docker image rm test-cert-manager.io + +.PHONY: server +server: docker-build + @docker run -d --name test-cert-manager.io --rm -p 3000:3000 -p 8888:8888 -v ${PWD}:/home/node/app -v /home/node/app/node_modules test-cert-manager.io ./scripts/server + +.PHONY: verify +verify: docker-build + @docker run --rm --name verify-cert-manager.io -v ${PWD}:/home/node/app -v /home/node/app/node_modules test-cert-manager.io ./scripts/verify + +.PHONY: release +release: docker-build + @docker run --rm --name verify-cert-manager.io -v ${PWD}:/home/node/app -v /home/node/app/node_modules test-cert-manager.io ./scripts/build-release