From 8fc8bf724814c31bfdbdf73d74d10d7d5372cdc5 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Sat, 30 Oct 2021 19:04:49 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Testing=20variations=20for=20tro?= =?UTF-8?q?ubleshooting=20socket.io=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.env | 2 +- docker-compose.yml | 183 ++++++++++++++++-------------- src/client/constants/endpoints.ts | 12 +- src/client/store/index.ts | 4 +- 4 files changed, 105 insertions(+), 96 deletions(-) diff --git a/docker-compose.env b/docker-compose.env index 7c4052c..a71250e 100644 --- a/docker-compose.env +++ b/docker-compose.env @@ -1 +1 @@ -LIBRARY_SOCKET_HOST=import \ No newline at end of file +LIBRARY_SOCKET_HOST=ws://importapi:3001 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 2eeec71..710e0c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,72 +12,80 @@ services: restart: unless-stopped labels: - "traefik.enable=true" + - "traefik.http.routers.threetwo-ui.rule=Host(`localhost`)" - "traefik.http.services.threetwo-ui.loadbalancer.server.port=8050" - "traefik.docker.network=proxy" ports: - "8050:8050" - "3050:3050" + links: + # - import + - importapi + # - libraryqueue depends_on: - db - redis - nats - traefik - importapi - - import - - imagetransformation + # - import + # - imagetransformation networks: - proxy - comicvineapi: - build: - context: https://github.com/rishighan/comicvine-service.git - image: frishi/comicvine-service - container_name: comicvine-api - ports: - - "3080:3080" - environment: - SERVICES: api - labels: - - "traefik.enable=true" - - "traefik.http.routers.comicvine-service.rule=Host(`localhost`)" - - "traefik.http.services.comicvine-service.loadbalancer.server.port=3080" - - "traefik.docker.network=proxy" - env_file: ./docker-env/comicvine-service.env - volumes: - - ./userdata:/comicvine-service/userdata - depends_on: - - nats - networks: - - proxy + # comicvineapi: + # build: + # context: https://github.com/rishighan/comicvine-service.git + # image: frishi/comicvine-service + # container_name: comicvine-api + # ports: + # - "3080:3080" + # environment: + # SERVICES: api + # labels: + # - "traefik.enable=true" + # - "traefik.http.routers.comicvine-service.rule=Host(`localhost`)" + # - "traefik.http.services.comicvine-service.loadbalancer.server.port=3080" + # - "traefik.docker.network=proxy" + # env_file: ./docker-env/comicvine-service.env + # volumes: + # - ./userdata:/comicvine-service/userdata + # depends_on: + # - nats + # networks: + # - proxy - comicvine: - build: - context: https://github.com/rishighan/comicvine-service.git - image: frishi/comicvine-service - container_name: comicvine-service - environment: - SERVICES: comicvine - volumes: - - ./userdata:/comicvine-service/userdata - env_file: ./docker-env/comicvine-service.env - networks: - - proxy + # comicvine: + # build: + # context: https://github.com/rishighan/comicvine-service.git + # image: frishi/comicvine-service + # container_name: comicvine-service + # environment: + # SERVICES: comicvine + # volumes: + # - ./userdata:/comicvine-service/userdata + # env_file: ./docker-env/comicvine-service.env + # networks: + # - proxy importapi: build: context: https://github.com/rishighan/threetwo-import-service.git image: frishi/threetwo-import-service - container_name: threetwo-import-api + container_name: importapi ports: - "3000:3000" - "3001:3001" + expose: + - "3001" environment: SERVICES: api labels: - "traefik.enable=true" - - "traefik.http.routers.threetwo-import-api.rule=Host(`localhost`)" - - "traefik.http.services.threetwo-import-api.loadbalancer.server.port=3000" + - "traefik.wss.protocol=http" + - "traefik.http.routers.importapi.rule=Host(`localhost`)" + - "traefik.http.services.importapi.loadbalancer.server.port=3000" - "traefik.docker.network=proxy" env_file: ./docker-env/threetwo-import-service.env volumes: @@ -89,57 +97,58 @@ services: networks: - proxy - import: - build: - context: https://github.com/rishighan/threetwo-import-service.git - image: frishi/threetwo-import-service - container_name: import - depends_on: - - db - - nats - environment: - SERVICES: import - DOCKER_RABBITMQ_CONNECTION_STRING: 'amqp://user:bitnami@rabbitmq:5672' - volumes: - - ./userdata:/threetwo-import-service/userdata - - ./comics:/threetwo-import-service/comics - env_file: ./docker-env/threetwo-import-service.env - networks: - - proxy + # import: + # build: + # context: https://github.com/rishighan/threetwo-import-service.git + # image: frishi/threetwo-import-service + # container_name: import + # ports: + # - "3001:3001" + # depends_on: + # - db + # - nats + # environment: + # SERVICES: import + # volumes: + # - ./userdata:/threetwo-import-service/userdata + # - ./comics:/threetwo-import-service/comics + # env_file: ./docker-env/threetwo-import-service.env + # networks: + # - proxy - imagetransformation: - build: - context: https://github.com/rishighan/threetwo-import-service.git - image: frishi/threetwo-import-service - container_name: image-transformation - volumes: - - ./userdata:/threetwo-import-service/userdata - - ./comics:/threetwo-import-service/comics - depends_on: - - db - - nats - environment: - SERVICES: imagetransformation - env_file: ./docker-env/threetwo-import-service.env - networks: - - proxy + # imagetransformation: + # build: + # context: https://github.com/rishighan/threetwo-import-service.git + # image: frishi/threetwo-import-service + # container_name: image-transformation + # volumes: + # - ./userdata:/threetwo-import-service/userdata + # - ./comics:/threetwo-import-service/comics + # depends_on: + # - db + # - nats + # environment: + # SERVICES: imagetransformation + # env_file: ./docker-env/threetwo-import-service.env + # networks: + # - proxy - libraryqueue: - build: - context: https://github.com/rishighan/threetwo-import-service.git - image: frishi/threetwo-import-service - container_name: library-queue - volumes: - - ./userdata:/threetwo-import-service/userdata - - ./comics:/threetwo-import-service/comics - depends_on: - - db - - nats - environment: - SERVICES: libraryqueue - env_file: ./docker-env/threetwo-import-service.env - networks: - - proxy + # libraryqueue: + # build: + # context: https://github.com/rishighan/threetwo-import-service.git + # image: frishi/threetwo-import-service + # container_name: library-queue + # volumes: + # - ./userdata:/threetwo-import-service/userdata + # - ./comics:/threetwo-import-service/comics + # depends_on: + # - db + # - nats + # environment: + # SERVICES: libraryqueue + # env_file: ./docker-env/threetwo-import-service.env + # networks: + # - proxy db: image: 'bitnami/mongodb:latest' diff --git a/src/client/constants/endpoints.ts b/src/client/constants/endpoints.ts index c021c6e..e3ff16a 100644 --- a/src/client/constants/endpoints.ts +++ b/src/client/constants/endpoints.ts @@ -36,9 +36,9 @@ export const IMPORT_SERVICE_BASE_URI = hostURIBuilder({ apiPath: "/api/import", }); -export const SOCKET_BASE_URI = hostURIBuilder({ - protocol: "http", - host: process.env.LIBRARY_SOCKET_HOST || "localhost", - port: "3001", - apiPath: `/`, -}); +// export const SOCKET_BASE_URI = hostURIBuilder({ +// protocol: "http", +// host: process.env.LIBRARY_SOCKET_HOST || "localhost", +// port: "3001", +// apiPath: `/`, +// }); diff --git a/src/client/store/index.ts b/src/client/store/index.ts index c63becd..a696653 100644 --- a/src/client/store/index.ts +++ b/src/client/store/index.ts @@ -5,8 +5,8 @@ import thunk from "redux-thunk"; import createRootReducer from "../reducers"; import socketIO from "socket.io-client"; import socketIoMiddleware from "redux-socket.io-middleware"; -import { SOCKET_BASE_URI } from "../constants/endpoints"; -const io = socketIO(SOCKET_BASE_URI); +// import { SOCKET_BASE_URI } from "../constants/endpoints"; +const io = socketIO(`ws://importapi:3001`); export const history = createBrowserHistory(); const configureStore = (initialState) => { const store = createStore(