diff --git a/Dockerfile b/Dockerfile index 7c0d184..881d2fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ ENV PATH="$PNPM_HOME:$PATH" WORKDIR /usr/src/app COPY . /usr/src/app -RUN corepack enable && pnpm install +RUN corepack enable && pnpm install && pnpm build && pnpm prune --prod -CMD ["pnpm", "start"] +CMD ["pnpm", "start:docker"] diff --git a/package.json b/package.json index 65734ca..b9ab637 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "tsc", "prestart": "pnpm build", - "start": "node --env-file=.env ./dist/index.js" + "start": "node --env-file=.env ./dist/index.js", + "start:docker": "node ./dist/index.js" }, "keywords": [], "author": "Alessandro Cifani ",