Skip to content
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
package-lock.json
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:23-alpine

WORKDIR /app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 8080

CMD ["node", "server.js"]
37 changes: 37 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
services:
backend:
Comment thread
SaranHiruthikM marked this conversation as resolved.
build: .
container_name: healoscope-backend
ports:
- "8080:8080"
environment:
PORT: 8080
MONGODB_URI: mongodb://mongo:27017/healoscope
JWT_SECRET: ${JWT_SECRET}
EMAIL_USER: ${EMAIL_USER}
EMAIL_PASS: ${EMAIL_PASS}
CLOUDINARY_NAME: ${CLOUDINARY_NAME}
CLOUDINARY_API_KEY: ${CLOUDINARY_API_KEY}
CLOUDINARY_API_SECRET: ${CLOUDINARY_API_SECRET}
GEMINI_API_KEY: ${GEMINI_API_KEY}
depends_on:
Comment thread
SaranHiruthikM marked this conversation as resolved.
mongo:
condition: service_healthy
restart: unless-stopped

mongo:
image: mongo
container_name: healoscope-mongo
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
restart: unless-stopped
healthcheck:
test: ["CMD", "mongo", "--quiet", "127.0.0.1/healoscope", "--eval", "db.runCommand('ping').ok"]
Comment thread
SaranHiruthikM marked this conversation as resolved.
interval: 10s
timeout: 5s
retries: 5

volumes:
mongo_data:
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import bodyParser from "body-parser";
import cors from "cors";
import mainRouter from "./routes/mainRouter.js";

const PORT = process.env.PORT | 8080;
const PORT = process.env.PORT || 8080;
const URI = process.env.MONGODB_URI;


Expand All @@ -25,4 +25,4 @@ app.listen(PORT, async () => {

// app.get("/", (req, res) => {
// res.send("Hello, I'm root");
// })
// })