From 0cbf3e3dc55caca56126b61cb801ad772f3c2ef8 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Fri, 26 Jun 2026 16:19:02 +0330 Subject: [PATCH] Fix Docker build by inlining WebSocket hook and copying full source --- .dockerignore | 3 +++ Dockerfile | 4 +--- nuxt.config.js | 8 +++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9de8de0..f513dfa 100644 --- a/.dockerignore +++ b/.dockerignore @@ -28,3 +28,6 @@ coverage *.swp yarn.lock + +*.archive +bargrest_bargtest.archive diff --git a/Dockerfile b/Dockerfile index a4be838..33fd1c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,8 +34,7 @@ WORKDIR /build RUN apk add --no-cache python3 make g++ -COPY package.json package-lock.json nuxt.config.js ./ -COPY assets components layouts middleware mixins modules pages plugins server static store ./ +COPY . . COPY --from=deps /deps/node_modules ./node_modules @@ -57,7 +56,6 @@ COPY --from=prod-deps --chown=appuser:appgroup /deps/node_modules ./node_modules COPY --from=builder --chown=appuser:appgroup /build/.nuxt ./.nuxt COPY --from=builder --chown=appuser:appgroup /build/static ./static COPY --from=builder --chown=appuser:appgroup /build/server ./server -COPY --from=builder --chown=appuser:appgroup /build/modules ./modules COPY --from=builder --chown=appuser:appgroup /build/nuxt.config.js /build/package.json ./ USER appuser diff --git a/nuxt.config.js b/nuxt.config.js index cdac840..04a8921 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -2,6 +2,7 @@ const webpack = require("webpack"); // const serverPort = 9964 || process.env.PORT const serverPort = 8959 || process.env.PORT; const fs = require("fs"); +const wss = require("./server/socket/init"); export default { // Global page headers: https://go.nuxtjs.dev/config-head @@ -60,9 +61,14 @@ export default { "@nuxtjs/axios", "@nuxtjs/auth-next", "@nuxtjs/firebase", - "~/modules/WebSocketServer.js", ], + hooks: { + listen(server) { + wss(server); + }, + }, + firebase: { // For Firebase JS SDK v7.20.0 and later, measurementId is optional config: {