1 Commits

Author SHA1 Message Date
091d6c8d46 Added Dockerfile 2022-10-31 02:05:05 +03:00
4 changed files with 19 additions and 3 deletions

View File

@@ -1,5 +1,4 @@
NODE_ENV=production NODE_ENV=production
PORT=3031
URI=mongodb://localhost?retryWrites=true&w=majority URI=mongodb://localhost?retryWrites=true&w=majority
FRONTEND=https://bingo.anatolykopyl.ru FRONTEND=https://bingo.anatolykopyl.ru
DB_NAME=vk_bingo DB_NAME=vk_bingo

11
backend/Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM node:16-alpine
WORKDIR /app
# Copy and download dependencies
COPY package.json package-lock.json ./
RUN npm install
# Copy the source files into the image
COPY . .
EXPOSE 3000
CMD npm start

View File

@@ -219,5 +219,10 @@ const client = new MongoClient(process.env.URI, { useUnifiedTopology: true });
} }
}); });
app.listen(process.env.PORT, () => console.log(`Server started on ${process.env.PORT}`)); app.listen(
3000,
'0.0.0.0',
511,
() => console.log(`Server started on port ${3000}`),
);
})(); })();

View File

@@ -4,7 +4,8 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "nodemon index.js" "dev": "nodemon index.js",
"start": "node index.js"
}, },
"author": "Anatoly Kopyl", "author": "Anatoly Kopyl",
"license": "ISC", "license": "ISC",