Skip to content

Commit

Permalink
Merge pull request #137 from harshit0571/#133-FEATURE-DOCKERIZE
Browse files Browse the repository at this point in the history
dockerfile added to client and server
  • Loading branch information
ItsRoy69 committed Oct 4, 2022
2 parents 3ecccff + f9bbc30 commit ef7fe7c
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
15 changes: 15 additions & 0 deletions client/Dockerfile
@@ -0,0 +1,15 @@
FROM node:16-alpine
WORKDIR '/app'

COPY package.json .
RUN npm install
COPY . .

CMD ["npm","start"]



# if facing error while building image, paste there two command in terminal.

# export DOCKER_BUILDKIT=0
# export COMPOSE_DOCKER_CLI_BUILD=0
34 changes: 34 additions & 0 deletions docker-compose.yaml
@@ -0,0 +1,34 @@
version: "3"
services:
react-app:
restart: always
build:
context: ./client
dockerfile: Dockerfile
image: react-app
stdin_open: true
ports:
- "3000:3000"
networks:
- mern-app
volumes:
- ./client/src:/app/src
- ./app/node_modules

api-server:
restart: always
build:
context: ./server
dockerfile: Dockerfile
image: api-server
ports:
- "5000:5000"
networks:
- mern-app
volumes:
- ./server:/app
- ./app/node_modules

networks:
mern-app:
driver: bridge
11 changes: 11 additions & 0 deletions server/Dockerfile
@@ -0,0 +1,11 @@
FROM node:16-alpine
WORKDIR '/app'

COPY package.json .
RUN npm install

COPY . .



CMD ["npm", "run", "dev"]
3 changes: 2 additions & 1 deletion server/package.json
@@ -1,7 +1,8 @@
{
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon index.js"
"start": "nodemon index.js",
"dev": "nodemon index.js"
},
"dependencies": {
"bcrypt": "^5.0.1",
Expand Down

1 comment on commit ef7fe7c

@vercel
Copy link

@vercel vercel bot commented on ef7fe7c Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

doc-talk – ./

doc-talk69.vercel.app
doc-talk-itsroy69.vercel.app
doc-talk-git-main-itsroy69.vercel.app

Please sign in to comment.