Compare commits

..

No commits in common. "aa5ef10e8524b9c5fb1072c3e6e89f159a306403" and "737b79eb5df573e69c36e741df0a0db8b13e33c6" have entirely different histories.

4 changed files with 3 additions and 44 deletions

View File

@ -5,7 +5,6 @@
!*.js !*.js
!*.sh !*.sh
!*.md !*.md
!.env
!config !config
config/local.json config/local.json
!client !client

View File

@ -29,21 +29,14 @@ FROM base AS production
RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \ RUN DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y \
git git
# Not sure if the root is actually used for anything...
WORKDIR /website WORKDIR /website
COPY /package.json /website/ COPY /package.json /website/
RUN npm install RUN npm install
COPY /.babelrc /*.html /*.js /website/ COPY /.babelrc /*.html /*.js /website/
COPY /src /website/src COPY /src /website/src
COPY /.env /website/ COPY /frontend /website/frontend
RUN npm run build RUN npm run build
# Polymer frontend app built using bower
WORKDIR /website/frontend
COPY /frontend /website/frontend
RUN npx -y bower -y install
# 'identities' frontend built using react
WORKDIR /website/client WORKDIR /website/client
COPY /client/package.json /website/client/ COPY /client/package.json /website/client/
RUN npm install RUN npm install
@ -51,7 +44,6 @@ COPY /client/tsconfig.json /website/client/
COPY /client/*.js /website/client/ COPY /client/*.js /website/client/
COPY /client/public /website/client/public COPY /client/public /website/client/public
COPY /client/src /website/client/src COPY /client/src /website/client/src
COPY /client/.env /website/client/
RUN npm run build RUN npm run build
# #
@ -89,7 +81,6 @@ WORKDIR /website/server
COPY /server/package.json /website/server/ COPY /server/package.json /website/server/
RUN npm install RUN npm install
COPY /.env /website/
COPY /config /website/config COPY /config /website/config
COPY /server/*.js /website/server/ COPY /server/*.js /website/server/
COPY /server/db /website/server/db COPY /server/db /website/server/db
@ -105,7 +96,7 @@ COPY /ketrface /website/ketrface
FROM runtime AS website FROM runtime AS website
RUN echo "Building PRODUCTION" RUN echo "Building PRODUCTION"
COPY /server/production.location /etc/nginx/snippets/active.location COPY /server/production.location /etc/nginx/snippets/active.location
COPY --from=production /frontend /website/frontend COPY /frontend /website/frontend
COPY --from=production /website/dist /website/dist COPY --from=production /website/dist /website/dist
COPY --from=production /website/*.html /website/ COPY --from=production /website/*.html /website/
COPY --from=production /website/client/build /website/client/build COPY --from=production /website/client/build /website/client/build

View File

@ -1,8 +1,4 @@
#!/bin/bash #!/bin/bash
fail() {
echo "$*" >&2
exit -1
}
if [[ "${TARGET_PORT}" != "" ]]; then if [[ "${TARGET_PORT}" != "" ]]; then
sed -i -e "s,8123,${TARGET_PORT},g" /etc/nginx/sites-enabled/default sed -i -e "s,8123,${TARGET_PORT},g" /etc/nginx/sites-enabled/default
@ -30,24 +26,6 @@ if [[ -z "${DEVELOPMENT}" ]]; then
{ while true; do npm start ; sleep 3 ; done ; } { while true; do npm start ; sleep 3 ; done ; }
else else
echo "Running in DEVELOPMENT mode." echo "Running in DEVELOPMENT mode."
if [[ -d /website/frontend/bower_components ]]; then
cd /website/frontend
npm install &&
npx bower install || fail "Unable to install frontend"
fi
if [[ -d /website/client/node_modules ]]; then
cd /website/client
npm install || fail "Unable to install client"
fi
if [[ -d /website/node_modules ]]; then
cd /website
npm install || fail "Unable to install website"
fi
if [[ -d /website/server/node_modules ]]; then
cd /website/server
npm install || fail "Unable to install server"
fi
cd /website/server cd /website/server
{ while true; do npm start ; sleep 3 ; done ; } & { while true; do npm start ; sleep 3 ; done ; } &
cd /website/client cd /website/client

View File

@ -91,17 +91,8 @@ app.use(function(req, res, next){
}); });
}); });
const dbPath = { ...config.get("sessions.db") };
let configPath = process.env.NODE_CONFIG_DIR;
if (configPath) {
configPath = configPath.replace(/config/, '');
} else {
configPath = './'
}
dbPath = `${configPath}${dbPath}`;
app.use(session({ app.use(session({
store: new SQLiteStore({ db: dbPath }), store: new SQLiteStore({ db: config.get("sessions.db") }),
secret: config.get("sessions.store-secret"), secret: config.get("sessions.store-secret"),
cookie: { maxAge: 7 * 24 * 60 * 60 * 1000 }, // 1 week cookie: { maxAge: 7 * 24 * 60 * 60 * 1000 }, // 1 week
saveUninitialized: false, saveUninitialized: false,