Dockerize

This commit is contained in:
Fred Boniface 2024-05-01 14:20:44 +01:00
parent 9a0d4e2261
commit 8f6a5aebb8
2 changed files with 16 additions and 1 deletions

15
Dockerfile Normal file
View File

@ -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"]

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"dev": "npx tsc && cp -r static/ build && node build/index.js", "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": { "repository": {
"type": "git", "type": "git",