From 5ac4aa6b807551ae5694cc838d60a724c1bb87ed Mon Sep 17 00:00:00 2001 From: Omer Sabic Date: Wed, 29 May 2024 20:58:13 +0200 Subject: [PATCH] i wanna kms --- Dockerfile | 20 ++++++++++++++++---- build/handler.js | 2 +- build/{index.mjs => index.js} | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) rename build/{index.mjs => index.js} (99%) diff --git a/Dockerfile b/Dockerfile index ff3ef8f..fab1241 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,17 @@ -FROM node:20-alpine -WORKDIR ./build +# Use the official Node.js image +FROM node:18-alpine + +# Create and set the working directory +WORKDIR /app + +# Copy the build folder to the working directory +COPY build ./build + +# Change directory to the build folder +WORKDIR /app/build + +# Make port 3000 available to the world outside this container, if necessary EXPOSE 3000 -ENV NODE_ENV=production -RUN ["node", "./index.mjs"] \ No newline at end of file + +# Run the application +CMD ["node", "--experimental-modules", "index.js"] diff --git a/build/handler.js b/build/handler.js index ffb7e72..1753297 100644 --- a/build/handler.js +++ b/build/handler.js @@ -26,7 +26,7 @@ function totalist(dir, callback, pre='') { /** * @typedef ParsedURL - * @type {import('./index.mjs').ParsedURL} + * @type {import('./index.js').ParsedURL} */ /** diff --git a/build/index.mjs b/build/index.js similarity index 99% rename from build/index.mjs rename to build/index.js index 29cf953..d121ab7 100644 --- a/build/index.mjs +++ b/build/index.js @@ -107,7 +107,7 @@ class Trouter { /** * @typedef ParsedURL - * @type {import('./index.mjs').ParsedURL} + * @type {import('./index.js').ParsedURL} */ /**