diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..16b35b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:lts AS runtime +WORKDIR /app + +COPY . . + +RUN npm install +RUN npm run build + +ENV HOST=0.0.0.0 +ENV PORT=4321 +EXPOSE 4321 +CMD node ./dist/server/entry.mjs \ No newline at end of file diff --git a/dockerfile b/dockerfile deleted file mode 100644 index 408cabc..0000000 --- a/dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# syntax=docker/dockerfile:1 - -# Stage 1: Base image. -## Start with a base image containing NodeJS so we can build Docusaurus. -FROM node:lts as base -## Disable colour output from yarn to make logs easier to read. -ENV FORCE_COLOR=0 -## Enable corepack. -RUN corepack enable -## Set the working directory to `/opt/docusaurus`. -WORKDIR /opt/docusaurus - -# Stage 2b: Production build mode. -FROM base as prod -## Set the working directory to `/opt/docusaurus`. -WORKDIR /opt/docusaurus -## Copy over the source code. -COPY . /opt/docusaurus/ -## Install dependencies with `--immutable` to ensure reproducibility. -npm create astro@latest -- --template starlight -## Build the static site. -RUN npm run build - -# Stage 3a: Serve with `docusaurus serve`. -FROM prod as serve -## Expose the port that Docusaurus will run on. -EXPOSE 3000 -## Run the production server. -CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"]