Dockerize gather
This commit is contained in:
9
gather/Dockerfile
Normal file
9
gather/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM node:20-alpine
|
||||
LABEL authors="anatolykopyl"
|
||||
|
||||
WORKDIR /usr/node/app
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
9
gather/docker-compose.yml
Normal file
9
gather/docker-compose.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
warframe-center-gather:
|
||||
image: git.radner.ru/anatolykopyl/warframe-center-gather:latest
|
||||
container_name: warframe-center-gather
|
||||
working_dir: /usr/node/app
|
||||
command: >
|
||||
sh -c "node src/index.js"
|
||||
@@ -1,9 +0,0 @@
|
||||
module.exports = {
|
||||
apps: [{
|
||||
name: 'warframe-center-gather',
|
||||
script: './src/index.js',
|
||||
watch: true,
|
||||
ignore_watch: ['node_modules', 'public'],
|
||||
restart_delay: 1 * 60 * 1000
|
||||
}]
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
"shared-stuff": "file:../shared-stuff"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"pm2": "^5.2.0"
|
||||
"eslint-config-standard": "^16.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ async function initDB () {
|
||||
await mongoose.connect(process.env.MONGODB_URI)
|
||||
}
|
||||
|
||||
(async () => {
|
||||
await initDB()
|
||||
const main = async (firstLaunch) => {
|
||||
if (firstLaunch) {
|
||||
await initDB()
|
||||
}
|
||||
|
||||
for (const item of items) {
|
||||
process.stdout.write(`Looking at ${item.name}: `)
|
||||
@@ -36,5 +38,13 @@ async function initDB () {
|
||||
console.log('✅')
|
||||
}
|
||||
|
||||
await mongoose.disconnect()
|
||||
})()
|
||||
await main()
|
||||
}
|
||||
|
||||
main(true)
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
mongoose.disconnect().then(() => {
|
||||
process.exit()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user