Skip to content

Commit

Permalink
some production fixes/changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robonau committed Nov 5, 2022
1 parent 783e7c1 commit f774faf
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# develop stage
FROM node:current-alpine as develop-stage
FROM node:18-alpine as develop-stage
WORKDIR /app
COPY package*.json ./
RUN npm install -g @quasar/cli
Expand All @@ -9,7 +9,7 @@ FROM develop-stage as build-stage
RUN npm install
RUN quasar build
# production stage
FROM nginx:1.17.5-alpine as production-stage
FROM nginx:1.23.2-alpine as production-stage
COPY --from=build-stage /app/dist/spa /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:

quasar-dev:
tachideskvui-dev:
build:
context: .
target: 'develop-stage'
Expand All @@ -10,9 +10,11 @@ services:
volumes:
- '.:/app'
command: /bin/sh -c "npm i && quasar dev"
restart: unless-stopped

quasar-prod:
tachideskvui-prod:
build:
context: .
ports:
- '9013:80'
restart: unless-stopped
4 changes: 2 additions & 2 deletions quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ module.exports = configure(function (/* ctx */) {
// extendSSRWebserverConf (esbuildConf) {},
// extendPackageJson (json) {},

pwa: false,
pwa: true,

// manualStoreHydration: true,
// manualPostHydrationTrigger: true,

prodPort: 3000, // The default port that the production server should use
prodPort: 80, // The default port that the production server should use
// (gets superseded if process.env.PORT is specified at runtime)

middlewares: [
Expand Down
6 changes: 1 addition & 5 deletions src/boot/StoreDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ if (LocalStorage.isEmpty()) {
LocalStorage.set('useCache', true);
LocalStorage.set('MitemW', 300);
LocalStorage.set('dark', true);
LocalStorage.set('ExtLangFilt', ['en']);
Dark.set(true);
// LocalStorage.set('', '');
// LocalStorage.set('', '');
// LocalStorage.set('', '');
// LocalStorage.set('', '');
// LocalStorage.set('', '');
}
3 changes: 2 additions & 1 deletion src/components/downloads/useDlSock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const eventsFromServer = ref('');
const isConnected = ref(false);
let base = LocalStorage.getItem('baseUrl') as string;
base =
base == '/' ? document.location.origin + document.location.pathname : base;
base == '' ? document.location.origin + document.location.pathname : base;
console.log(base);
const url = new URL(base);
url.protocol = url.protocol == 'https:' ? 'wss:' : 'ws:';
let socket: WebSocket;
Expand Down
15 changes: 15 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ import routes from './routes';
*/

export default route(function (/* { store, ssrContext } */) {
// i honistly dont know the proper fix for this
if (window.process == undefined) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.process = {
env: {
SERVER: '',
NODE_ENV: '',
VUE_ROUTER_MODE: 'hash',
VUE_ROUTER_BASE: '/'
}
};
}

const createHistory = process.env['SERVER']
? createMemoryHistory
: process.env.VUE_ROUTER_MODE === 'history'
Expand All @@ -34,6 +48,7 @@ export default route(function (/* { store, ssrContext } */) {
// Leave this as is and make changes in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath

history: createHistory(process.env.VUE_ROUTER_BASE)
});

Expand Down

0 comments on commit f774faf

Please sign in to comment.