Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:added docker environment to api setup #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
PORT=3031
MONGOURL = 'mongodb+srv://heroku:UejJi2wJS5iYrEeG@cluster0.epju3.mongodb.net/E-Commerce?retryWrites=true&w=majority'
MONGOURL = "mongodb://localhost:5006"
MONGODB_USERNAME=
MONGODB_PASSWORD=
MONGODB_PORT=5006
seller_password = '<seller_password>'
buyer_password = '<buyer_password>'
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:12-alpine

WORKDIR /app

COPY package.json /

RUN npm install

COPY . .

CMD npm start
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3.6"
services:
application:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- $PORT:$PORT
image: backend-api
stdin_open: true



mongodb:
image: mongo
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD}
ports:
- $MONGODB_PORT:27107
volumes:
- db:/mongodb/datastore
stdin_open: true
tty: true

volumes:
db:
Loading