Skip to content

Commit

Permalink
feat-krishnaacharyaa#131 Dockerize the application
Browse files Browse the repository at this point in the history
  • Loading branch information
adityasamant25 committed Apr 22, 2024
1 parent 230c2fb commit d4b19cb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:21
WORKDIR /app
COPY . .
RUN npm i
COPY .env.sample .env
EXPOSE 5000
CMD ["npm", "start"]

28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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:
7 changes: 7 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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 d4b19cb

Please sign in to comment.