fix deploying process

This commit is contained in:
Alexey 2020-03-02 12:09:41 +03:00
parent 777697f907
commit f2bb2eaf6e
3 changed files with 4 additions and 11 deletions

View File

@ -11,5 +11,4 @@ COPY --from=bin /usr/bin/phase2_verify_contribution /app/server/bin/
EXPOSE 3000
HEALTHCHECK CMD curl -f http://localhost:3000/
RUN yarn build
CMD ["yarn", "start"]

View File

@ -6,7 +6,7 @@
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
"build": "nuxt build",
"build": "cross-env NODE_ENV=production nuxt build",
"start": "cross-env NODE_ENV=production node server/index.js",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."

View File

@ -14,19 +14,13 @@ const attestationWatcher = require('./attestationWatcher')
const app = express()
async function start() {
config.dev = NODE_ENV !== 'production'
await models.sequelize.sync()
const nuxt = new Nuxt(config)
const { host, port } = nuxt.options.server
// Build only in dev mode
if (config.dev) {
const builder = new Builder(nuxt)
await builder.build()
} else {
await nuxt.ready()
}
const builder = new Builder(nuxt)
await builder.build()
app.use(
session({
secret: process.env.SESSION_SECRET,