From c8c28cc242460fcefcf104095f41bfb444ac0d4e Mon Sep 17 00:00:00 2001 From: Veinar Date: Wed, 8 Nov 2023 22:57:10 +0100 Subject: [PATCH] PR review changes Signed-off-by: Veinar --- .dockerignore | 1 + Containerfile | 4 ++-- README.md | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/Containerfile b/Containerfile index be683a1..c72d234 100644 --- a/Containerfile +++ b/Containerfile @@ -1,10 +1,10 @@ # Use the NODE_VERSION argument to specify the Node.js version -ARG NODE_VERSION +ARG NODE_VERSION=20 # Use the specified Node.js version as the base image FROM node:${NODE_VERSION}-alpine -# Set Node args +# Set Node args (do not set in node version 16 and below) ENV NODE_OPTIONS=--openssl-legacy-provider RUN apk add --update autoconf automake build-base libtool nasm pkgconf && \ diff --git a/README.md b/README.md index 5b88785..3812b2b 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,12 @@ yarn start **Docker setup** ```shell +# Build container image from local filesystem with default Node version +docker build --no-cache -t website: -f Containerfile . + # Build container image from local filesystem with Node version as build arg docker build --build-arg NODE_VERSION=19 --no-cache -t website: -f Containerfile . # Run container image with mapping port 80 on your computer -docker run -dit -p 80:8000 website: +docker run -dit -p 8000:8000 website: ```