Compare commits

..

2 Commits

Author SHA1 Message Date
blek 05c39487d8
strip down useless and time consuming commands 2023-03-26 12:53:02 +10:00
blek df62d899a1
dont execute any commands on startup 2023-03-26 12:52:14 +10:00
3 changed files with 1 additions and 32 deletions

View File

@ -4,7 +4,4 @@ WORKDIR /opt/code
COPY . /opt/code
RUN rm -rf node_modules package-lock.json yarn.lock && \
./install
CMD [ "npm", "run", "dev" ]

View File

@ -4,7 +4,4 @@ WORKDIR /opt/code
COPY . /opt/code
RUN rm -rf node_modules package-lock.json yarn.lock && \
./install
CMD [ "npm", "run", "prod" ]

View File

@ -2,8 +2,6 @@ console.log('Executing startup jobs...');
const fs = require('fs');
const { crc32 } = require('easy-crc');
const glob = require('glob');
const { exec } = require('child_process');
const hrt = () => {
let hr = process.hrtime();
@ -29,36 +27,13 @@ if (process.env.APP_DEBUG == 'true') {
// build resume page
if ((!fs.existsSync('public/static/dist/resume.js')) && (!process.env.APP_DEBUG)) {
console.log('Resume files do not exist, building it automatically...');
exec('react/resume/build.sh');
console.log('Resume files do not exist!');
}
// load key
if (!process.env.APP_KEY)
throw new Error('APP_KEY is not set.')
// import gpg keys
glob('data/userdata/*_gpgkey', async (err, files) => {
if (err) {
console.error(err);
process.exit(-1);
}
files.filter(
file => {
return !file.startsWith('.')
}
).forEach(file => {
exec('gpg --import ' + file, (err, stdout, stderr) => {
if (err) {
console.error(`Errors while importing ${file}: ${err}`);
process.exit(-1);
}
console.log(`Imported ${file} key`);
});
});
});
console.log('Using a key with CRC32: ' + crc32('CRC-32', process.env.APP_KEY));
async function startup() {