Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18-alpine
Comment thread
SaranHiruthikM marked this conversation as resolved.
Outdated

WORKDIR /app

COPY package*.json ./
Comment thread
SaranHiruthikM marked this conversation as resolved.
Outdated

RUN npm install

COPY . .

EXPOSE 8080

CMD ["node", "server.js"]
28 changes: 28 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.8'
Comment thread
SaranHiruthikM marked this conversation as resolved.
Outdated

services:
backend:
Comment thread
SaranHiruthikM marked this conversation as resolved.
build: .
container_name: healoscope-backend
ports:
- "8080:8080"
environment:
- PORT=8080
- MONGO_URI=mongodb://mongo:27017/healoscope
Comment thread
SaranHiruthikM marked this conversation as resolved.
Outdated
depends_on:
Comment thread
SaranHiruthikM marked this conversation as resolved.
- mongo
volumes:
- .:/app
Comment thread
SaranHiruthikM marked this conversation as resolved.
Outdated
restart: unless-stopped

mongo:
image: mongo
container_name: healoscope-mongo
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
restart: unless-stopped

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");
// })
// })