From c7cbf5f935637a79daed550724accfd387b13c0a Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 17 Oct 2023 16:26:15 +0000 Subject: [PATCH 1/5] static build outputs --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9457a47..330b1a7 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "prepare": "husky install", "dev": "next", "build": "next build", + "export": "next export", "build:analyze": "cross-env ANALYZE=true yarn build", "postbuild": "next-sitemap", "start": "next start", From 5618200fc55ac2ac913755f59208a7a4960ee16b Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 17 Oct 2023 16:49:34 +0000 Subject: [PATCH 2/5] instructions --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e739b52..bc54072 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,11 @@ yarn dev yarn build yarn start ``` + +### Static build + +``` +yarn export +``` + +creates `./out` From 74d51bd8ddf599992a06125266dd1015105ffe68 Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 17 Oct 2023 16:36:42 -0400 Subject: [PATCH 3/5] dockerfile --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5b361fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Specify the base image +FROM node:lts-alpine + +# Set the working directory inside the container +WORKDIR /app + +# Copy package.json and package-lock.json (if available) to the working directory +COPY package*.json ./ + +# Install dependencies +RUN yarn + +# Copy the rest of the application code +COPY . . + +RUN yarn build + +# Expose a port (if your app needs to listen on a specific port) +EXPOSE 3000 + +# Define the command to run your app +CMD ["yarn", "start"] From 5a259a866c52a6ef5aacaf9d5f0d86401f8f9781 Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 17 Oct 2023 16:54:09 -0400 Subject: [PATCH 4/5] modifications --- Dockerfile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5b361fb..360257a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,13 @@ -# Specify the base image FROM node:lts-alpine -# Set the working directory inside the container +ARG NEXT_PUBLIC_DATOCMS_BYPASS_TYPE=local_json + WORKDIR /app -# Copy package.json and package-lock.json (if available) to the working directory -COPY package*.json ./ - -# Install dependencies -RUN yarn - -# Copy the rest of the application code COPY . . -RUN yarn build +RUN yarn && yarn build -# Expose a port (if your app needs to listen on a specific port) EXPOSE 3000 -# Define the command to run your app CMD ["yarn", "start"] From f896a353c481462fbc8c5dbad1b3346a93f9e58b Mon Sep 17 00:00:00 2001 From: zramsay Date: Wed, 18 Oct 2023 11:04:28 -0400 Subject: [PATCH 5/5] use lts-slim --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 360257a..a8cc5fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:lts-alpine +FROM node:lts-slim ARG NEXT_PUBLIC_DATOCMS_BYPASS_TYPE=local_json