Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Builds Docker image of backend component with multi-stage Dockerfile Updates package.json `npm start` command Delete unnecessary `npm run start` commands
Shakar23418b3a097c
diff --git a/backend/Dockerfile b/backend/Dockerfileindex e4d283a779..bbbe2a1a78 100644--- a/backend/Dockerfile+++ b/backend/Dockerfile@@ -1,18 +1,28 @@-FROM node:16-bullseye-slim+FROM node:16-bullseye-slim AS buildWORKDIR /app+COPY package*.json ./++RUN npm ci --only-production --ignore-scripts++COPY . .++RUN npm run build-COPY package.json package-lock.json ./-# RUN npm ci --only-production --ignore-scripts-# "prepare": "cd .. && npm install"++FROM node:16-bullseye-slim++WORKDIR /app+COPY package*.json ./RUN npm ci --only-production-COPY . .+COPY --from=build /app .HEALTHCHECK --interval=10s --timeout=3s --start-period=10s \CMD node healthcheck.js+EXPOSE 4000CMD ["npm", "run", "start"]diff --git a/backend/package.json b/backend/package.jsonindex 89bd52b07e..795fc68ed9 100644--- a/backend/package.json+++ b/backend/package.json@@ -48,7 +48,7 @@"version": "1.0.0","main": "src/index.js","scripts": {- "start": "npm run build && node build/index.js",+ "start": "node build/index.js","dev": "nodemon","swagger-autogen": "node ./swagger/index.ts","build": "rimraf ./build && tsc && cp -R ./src/templates ./build",diff --git a/docker-compose.yml b/docker-compose.ymlindex 6143695f5a..f1b8f7d05a 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -1,4 +1,4 @@-version: '3'+version: "3"services:nginx:@@ -22,7 +22,6 @@ services:depends_on:- mongoimage: infisical/backend- command: npm run startenv_file: .envenvironment:- NODE_ENV=production