Docker installation not working
License and Copyright Notice
By submitting this issue or commenting on this issue, or contributing any content to this issue, you certify under the Developer Certificate of Origin that the content you post may be licensed under GPLv3 (for code) or CC-BY-SA 4.0 International (for non-code content).
What is the goal or the problem, and why is it important?
After cloning the repo and running docker-compose up
only the backend and mongo services work. The frontend service exits after
place_order_front-end | (node:22) ExperimentalWarning: The WHATWG Encoding Standard implementation is an experimental API. It should not yet be used in production applications.
place_order_front-end | ℹ 「wds」: Project is running at http://172.19.0.4/
place_order_front-end | ℹ 「wds」: webpack output is served from
place_order_front-end | ℹ 「wds」: Content not from webpack is served from /srv/app/front-end/public
place_order_front-end | ℹ 「wds」: 404s will fallback to /
place_order_front-end | Starting the development server...
place_order_front-end |
place_order_front-end | npm info lifecycle front-end@0.1.0~poststart: front-end@0.1.0
place_order_front-end | npm info ok
place_order_front-end exited with code 0
The frontend works when run just from node. The only time it fails is with docker.
This was tried multiple times with multiple different machines and OSes.
This is important as the Frontend doesn't run on docker and needs a manual start using npm. Solving this will make the running of the module much easier.
How are you going to achieve the goal or solve the problem?
The goal will be achieved by doing some testing and changing the Docker files and testing again. Basically, it will be a trial and error method to figure out what was the issue causing the failure and the solution to fix it.
What will be produced as a result of this effort and where will it live on GitLab?
As a result the whole module would be dockerized and running. It will live on PlaceOrderModule\Frontend and may also be in the Docker-compose file of the Parent Directory.
Note: Changes will be in ditch-react branch until merged to master.
Give a justification of weight or due date.
This has been assigned, 4 which means a week of work. This has been assigned considering the testing of the Docker containers.
Who will do it, and what will they do?
@np370688 is responsible for this issue.
What was the outcome?
After we changed from react to jQuery, I decided to use Nginx server. This is because of several reasons:
- Nginx is faster than node in handling user requests.
- Nginx is also able to handle a very large number of concurrent user requests with a very low memory capacity.
- More information can be found here: Comparison between node and nginx.
The Frontend was changed to used Nginx image. The Nginx defaults to port 80(http). This led to create a redirect for requests on port 3000 to port 80 on docker-compose. The Frontend, now, runs on docker container directly by running the docker-compose.