Browse Source

ci: fix Dockerfile + quasar build context

NGPixel 2 years ago
parent
commit
123b0e15d4
2 changed files with 17 additions and 10 deletions
  1. 12 5
      dev/build/Dockerfile
  2. 5 5
      ux/quasar.config.js

+ 12 - 5
dev/build/Dockerfile

@@ -1,9 +1,9 @@
 # ====================
 # ====================
 # --- Build Assets ---
 # --- Build Assets ---
 # ====================
 # ====================
-FROM node:18 AS assets
+FROM node:20 AS assets
 
 
-RUN apt-get update && apt-get install build-essential -y
+RUN apt-get update && apt-get install -qy build-essential
 
 
 WORKDIR /wiki
 WORKDIR /wiki
 
 
@@ -17,11 +17,18 @@ RUN cd ux && \
 # ===============
 # ===============
 # --- Release ---
 # --- Release ---
 # ===============
 # ===============
-FROM node:18-alpine
+FROM node:20
 LABEL maintainer="requarks.io"
 LABEL maintainer="requarks.io"
 
 
-RUN apk add bash curl git openssh gnupg --no-cache && \
-    mkdir -p /wiki && \
+RUN apt-get update && apt-get install -qy --no-install-recommends \
+    bash \
+    curl \
+    git \
+    gnupg \
+    openssh-client \
+    pandoc \
+    && rm -rf /var/lib/apt/lists/*
+RUN mkdir -p /wiki && \
     mkdir -p /logs && \
     mkdir -p /logs && \
     mkdir -p /wiki/data/content && \
     mkdir -p /wiki/data/content && \
     chown -R node:node /wiki /logs
     chown -R node:node /wiki /logs

+ 5 - 5
ux/quasar.config.js

@@ -13,11 +13,11 @@ const path = require('path')
 const yaml = require('js-yaml')
 const yaml = require('js-yaml')
 const fs = require('fs')
 const fs = require('fs')
 
 
-module.exports = configure(function (/* ctx */) {
-  const userConfig = {
+module.exports = configure(function (ctx) {
+  const userConfig = ctx.dev ? {
     dev: { port: 3001, hmrClientPort: 3001 },
     dev: { port: 3001, hmrClientPort: 3001 },
     ...yaml.load(fs.readFileSync(path.resolve(__dirname, '../config.yml'), 'utf8'))
     ...yaml.load(fs.readFileSync(path.resolve(__dirname, '../config.yml'), 'utf8'))
-  }
+  } : {}
 
 
   return {
   return {
     eslint: {
     eslint: {
@@ -123,7 +123,7 @@ module.exports = configure(function (/* ctx */) {
     devServer: {
     devServer: {
       // https: true
       // https: true
       open: false, // opens browser window automatically
       open: false, // opens browser window automatically
-      port: userConfig.dev.port,
+      port: userConfig.dev?.port,
       proxy: {
       proxy: {
         '/_graphql': `http://127.0.0.1:${userConfig.port}/_graphql`,
         '/_graphql': `http://127.0.0.1:${userConfig.port}/_graphql`,
         '/_site': `http://127.0.0.1:${userConfig.port}`,
         '/_site': `http://127.0.0.1:${userConfig.port}`,
@@ -131,7 +131,7 @@ module.exports = configure(function (/* ctx */) {
         '/_user': `http://127.0.0.1:${userConfig.port}`
         '/_user': `http://127.0.0.1:${userConfig.port}`
       },
       },
       hmr: {
       hmr: {
-        clientPort: userConfig.dev.hmrClientPort
+        clientPort: userConfig.dev?.hmrClientPort
       },
       },
       vueDevtools: true
       vueDevtools: true
     },
     },