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

Docker configuration #187

Merged
merged 9 commits into from
Sep 8, 2023
Merged
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/*
.env
28 changes: 28 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ===================Server Port===================
PORT = 3000


# ===================MongoDB Url===================
MONGO_DB_URL = 'Paste mongodb url here'


# ===================Platform Name===================
PLATFORM_NAME = 'GetMyDeal'


# ===================Cookiee Key===================
SESSION_SECRET_KEY = 'Paste SESSION-SECRET-KEY here'


# ===================Payment Gateway Credentials - Razorpay===================
RAZORPAY_KEY_ID = "Paste RAZORPAY_KEY_ID here"

RAZORPAY_SECRET_KEY = "Paste RAZORPAY_SECRET_KEY here"


# ===================OTP Verification Service Credentials - Twilio ===================
TWILIO_ACCOUNT_SID = "Paste TWILIO_ACCOUNT_SID here"

TWILIO_AUTH_TOKEN = "Paste TWILIO_AUTH_TOKEN here"

TWILIO_VERIFY_SID = "Paste TWILIO_VERIFY_SID here"
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Command to configure the base image (official Node.js base image)
FROM node:18.16

# Command to update the base image
RUN apt update

# Set the working directory for the container
WORKDIR /app

# Command to copy the package files to working direcotory of the container
COPY package*.json .

# Install dependencies inside the container
RUN npm install

# Copy all the files from the existing directory to the docker container
COPY . .

# Command to set a fixed port for container to listen (exposing a port)
EXPOSE 3000

# Specify the default command to run the application inside the container
CMD ["npm", "start"]
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"
services:
webserver:
build:
dockerfile: Dockerfile
context: ./
image: webserver-image:v1 # This will set the image name and tag while building the image from dockerfile using docker compose
container_name: webserver # This will set the container name while starting it from docker compose
ports:
- 3000:3000
restart: on-failure
# volumes:
# - .:/app
env_file:
- ./.env