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",