Page MenuHomePhabricator

Backend server is not starting in dockerized image
Closed, ResolvedPublic

Description

The new version of the tool has been dockerized and is made into a monorepo.

The current issue is that when backend server starts, the mongodb instance has not started yet and it generates an error that stops the docker from running.

I tried to solve this issue using docker-compose-wait but could not get it to work.

You can find the latest code here: https://gerrit.wikimedia.org/g/labs/tools/VideoCutTool/+/366a3fa9a465eb1eeec66d128f8f64c3ba63b83a

Helpful guides

Event Timeline

diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 5c2f72a..4257816 100644

  • a/docker-compose.dev.yml

+++ b/docker-compose.dev.yml
@@ -8,6 +8,7 @@ services:

volumes:
  - ./src:/app/src:ro
  - ./server:/app/server

Earlier there was no node modules for server directory and thats why socket.io not found error was coming
+ - '/app/server/node_modules'

  • ./public:/app/public
  • '/app/node_modules' ports:

@@ -16,6 +17,7 @@ services:

environment:
  - CHOKIDAR_USEPOLLING=true
  - NODE_ENV=development

//just to make sure that if container stops they restart automatically
+ restart: always

links:
  - mongo
depends_on:

@@ -23,5 +25,6 @@ services:

mongo:
  container_name: videocuttool-mongo
  image: 'mongo:4'

//just to make sure that if container stops they restart automatically
+ restart: always

ports:
  - '27017:27017'

Thank you @shreyaansjain06 for trying out and proposing the solution :)

Thanks for sharing this in Zulip! :-)

image.png (1×2 px, 391 KB)

@Khr2003 Can you please try this and provide your feedback?