Skip to content

Commit

Permalink
feat-krishnaacharyaa#131 Dockerizing the app
Browse files Browse the repository at this point in the history
  • Loading branch information
ManmohansinghOfficial committed Apr 29, 2024
1 parent 8178444 commit b141df4
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
14 changes: 14 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:21

WORKDIR /app

COPY . .

RUN npm i

COPY .env.sample .env

EXPOSE 5000

CMD ["npm","start"]

31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "3.8"
services:

mongodb:
container_name: mongo
image: mongo:latest
volumes:
- ./backend/data:/data
ports:
- "27017:27017"

backend:
container_name: backend
build: ./backend
env_file:
- ./backend/.env.sample
ports:
- "5000:5000"
depends_on:
- mongodb

frontend:
container_name: frontend
build: ./frontend
env_file:
- ./backend/.env.sample
ports:
- "5173:5173"

volumes:
data:
14 changes: 14 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:21

WORKDIR /app

COPY . .

RUN npm i

COPY .env.sample .env.local

EXPOSE 5173

CMD ["npm","run","dev","--","--host"]

0 comments on commit b141df4

Please sign in to comment.