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 EXPOSE 3000
HEALTHCHECK CMD curl -f http://localhost:3000/ HEALTHCHECK CMD curl -f http://localhost:3000/
RUN yarn build
CMD ["yarn", "start"] CMD ["yarn", "start"]

View File

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

View File

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