Tempistemp / Dockerfile
Akwbw's picture
Create Dockerfile
c524e8f verified
raw
history blame contribute delete
781 Bytes
# Node.js ka latest version use karenge
FROM node:18
# Working directory banayein
WORKDIR /app
# GitHub se Shelex wala code clone karein
RUN git clone https://github.com/Shelex/free-otp-api.git .
# Dependencies install karein
RUN npm install
# Hugging Face port 7860 demand karta hai, isliye code mein port change karenge
# Hum sed command se port 3000 ko 7860 se replace kar rahe hain
RUN sed -i 's/3000/7860/g' index.js
# CORS enable karein taaki aap kisi bhi HTML se isay call kar sakein
RUN npm install cors
# Code mein CORS add karne ke liye thoda modification (Linux command se)
RUN sed -i "s/const app = express();/const app = express(); const cors = require('cors'); app.use(cors());/g" index.js
# Port open karein
EXPOSE 7860
# App start karein
CMD ["npm", "start"]