Skip to content

Commit

Permalink
Merge pull request #6 from TheMohit2003/dockerFiles
Browse files Browse the repository at this point in the history
added docker files
  • Loading branch information
TheMohit2003 authored Feb 21, 2024
2 parents d537ba1 + 83610b8 commit 2508a42
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

FROM node:16-alpine


WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3000

# Define environment variables
ENV NODE_ENV=production
ENV DATABASE_URL=yourDatabaseConnectionString
ENV JWT_SECRET=yourJWTSecretKey

# Command to run the app
CMD ["node", "index.js"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.8'
services:
app:
build: .
ports:
- '3000:3000'
environment:
NODE_ENV: production
DATABASE_URL: yourDatabaseConnectionString
JWT_SECRET: yourJWTSecretKey
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
command: npm start

0 comments on commit 2508a42

Please sign in to comment.