From 71da8d04eef6acdb4559501216968d3ae78ebe33 Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Sun, 2 Apr 2023 16:09:45 +0300 Subject: [PATCH] wip --- Dockerfile | 4 ++-- src/index.ts | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23a04a3..8d2ae21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16 +FROM node:latest # Create app directory WORKDIR /usr/src/app @@ -15,5 +15,5 @@ RUN npm install # Bundle app source COPY . . -EXPOSE 8080 +EXPOSE ${PORT} CMD [ "node", "dist/index.js" ] \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index d8dfac6..39ee401 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,10 @@ import GameSource from './GameSource'; import fs from 'fs'; import Ics from './Ics'; import express from 'express' +import env from 'dotenv'; + +env.config(); + const CronJob = require('cron').CronJob; @@ -52,13 +56,10 @@ const job = new CronJob( true, 'Asia/Jerusalem' ); - - - const webServer = express(); webServer.use(express.static('public')) -webServer.listen(3000, () => { - console.log('Example app listening on port 3000!') +webServer.listen(process.env.PORT, () => { + console.log('Example app listening on port '+process.env.PORT+'!') }) \ No newline at end of file