1.0.1
This commit is contained in:
commit
3045c8db4f
4 changed files with 17 additions and 3 deletions
15
Dockerfile
15
Dockerfile
|
@ -1,8 +1,21 @@
|
|||
FROM node:11
|
||||
|
||||
ENV NODE_ENV production
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
|
||||
RUN npm install --production --silent && mv node_modules ../
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
CMD npm start
|
||||
|
||||
RUN mkdir -p /data/db
|
||||
ENV DB_URL /data/db
|
||||
|
||||
RUN mkdir -p /data/sessions
|
||||
ENV SESSION_STORE /data/sessions
|
||||
|
||||
ENV SECRET_DIRNAME /data
|
||||
|
||||
CMD npm start
|
||||
|
|
|
@ -8,6 +8,7 @@ module.exports = {
|
|||
port: Number(process.env.PORT) || 3000,
|
||||
proxyServer: process.env.PROXY_SERVER || undefined,
|
||||
secret: process.env.SECRET || require('./secret'),
|
||||
sessionStore: process.env.SESSION_STORE || './sessions',
|
||||
sessionMaxAge: Number(process.env.SESSION_MAX_AGE) || 1000 * 60 * 60 * 24 * 7,
|
||||
siteTitle: process.env.SITE_TITLE || 'Christmas Community',
|
||||
useCDN: yesNo.parse(process.env.USE_CDN || true),
|
||||
|
|
|
@ -2,7 +2,7 @@ const uuid = require('uuid/v4');
|
|||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const secretFilePath = path.join(__dirname, 'secret.txt');
|
||||
const secretFilePath = path.join((process.env.SECRET_DIRNAME ? process.env.SECRET_DIRNAME : __dirname), 'secret.txt');
|
||||
|
||||
try {
|
||||
module.exports = fs.readFileSync(secretFilePath).toString();
|
||||
|
|
2
index.js
2
index.js
|
@ -44,7 +44,7 @@ passport.deserializeUser((user, callback) => {
|
|||
|
||||
|
||||
const LevelStore = expressSessionLevel(session);
|
||||
const sessionDb = level('./sessions')
|
||||
const sessionDb = level(config.sessionStore)
|
||||
|
||||
app.use(require('body-parser').urlencoded({ extended: true }));
|
||||
app.use(session({
|
||||
|
|
Loading…
Reference in a new issue