Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
feat: docker deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Sep 14, 2024
1 parent e0bd1f4 commit 8078db9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
dist
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG NODE_ENV=production
ARG NODE_VERSION=22

# Base image
FROM node:${NODE_VERSION}

# Create app directory
WORKDIR /usr/src/app

# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY package*.json ./

# Install app dependencies
RUN npm ci --ignore-scripts

# Bundle app source
COPY . .

# Prisma
RUN npx prisma generate

# Creates a "dist" folder with the production build
RUN npm run build

EXPOSE 3000

# Start the server using the production build
CMD [ "node", "dist/main.js" ]
2 changes: 1 addition & 1 deletion captain-definition
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"schemaVersion": 2,
"templateId": "node/22.8"
"dockerfilePath": "./Dockerfile"
}

0 comments on commit 8078db9

Please sign in to comment.