From 8f6a5aebb89e0a4561970c5698c60db5ce64042c Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 1 May 2024 14:20:44 +0100 Subject: [PATCH] Dockerize --- Dockerfile | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c8ce051 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:latest as builder +WORKDIR /usr/src/app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM node:14 +RUN apt-get update && apt-get install -y ghostscript +WORKDIR /usr/src/app +COPY --from=builder /usr/src/app/package*.json ./ +COPY --from=builder /usr/src/app/build ./dist +RUN npm install --only=production +EXPOSE 3000 +CMD ["node", "dist/index.js"] \ No newline at end of file diff --git a/package.json b/package.json index ac8efe0..496d769 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "npx tsc && cp -r static/ build && node build/index.js", - "build": "npx tsc && cp -r static/ views/ build" + "build": "npx tsc && cp -r static/ views/ sh/ build" }, "repository": { "type": "git",