Skip to content

Commit

Permalink
feat-krishnaacharyaa#131 Dockerise the application
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravs30 committed Jul 10, 2024
1 parent 5372d70 commit 3317d88
Show file tree
Hide file tree
Showing 4 changed files with 58 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:22

WORKDIR /app

COPY . .

RUN npm i

COPY .env.sample .env

EXPOSE 8080

CMD ["npm", "start"]

Empty file added backend/config/db
Empty file.
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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:
- ./frontend/.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:22

WORKDIR /app

COPY . .

RUN npm i

COPY .env.sample .env.local

EXPOSE 5173

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

0 comments on commit 3317d88

Please sign in to comment.