Giter VIP home page Giter VIP logo

Comments (11)

Sicaine avatar Sicaine commented on July 26, 2024 1

I hacked together a multi stage dockerfile for the Frontend. With it, you don't need to install anything on your host to build it:

I think it works, but i hacked it together and wanted to share it before i forget about it.

Btw. it doesn't build with nodejs 12 and there are plenty of warnings and deprecations for the used libs. So be careful if you put out the Frontend without protection.

FROM ubuntu:20.04 as build

RUN apt update && apt install -y curl sudo

RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

RUN apt update && apt install --no-install-recommends --no-install-suggests -y nodejs python2.7 build-essential

WORKDIR /dist

COPY . .
 
RUN npm install && npm run compile



FROM nginx:latest

RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y curl

# Set a timezone
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY default /etc/nginx/conf.d/default.conf
COPY --from=build /dist/dist /usr/share/nginx/html

CMD echo $api > /usr/share/nginx/html/apiUrl.txt && nginx -g "daemon off;"

HEALTHCHECK --interval=5s --timeout=30s --retries=50 \
  CMD curl -f localhost:80 || exit 1

from ambar.

ark- avatar ark- commented on July 26, 2024 1

I had this same issue. Take a look at step 3

  1. If compiling this on a different machine than what you're deploying on then before performing compile export PORT={YOUR_WEB_FRONTEND_PORT) and export FRONTEND_HOST={YOUR_HOST_IP}. I used 80 and 192.168.1.1.

If you compiling in a docker on the same machine (as I was) you'll also need to do this. Try setting these variables and see if this helps.

from ambar.

mlucasdasilva avatar mlucasdasilva commented on July 26, 2024 1

Instead of:

npm install && npm run compile

Try:

npm install && npm run deploy:prd

It worked for me.
It generated the files in ./FrontEnd/dist without fixed IP and Port.

from ambar.

kitsune242 avatar kitsune242 commented on July 26, 2024

THX
i build all but when docker start i have infinite loading screen and white board on localhost:82 in logs i dont see any errors. Anyone have similar problem ?

from ambar.

kitsune242 avatar kitsune242 commented on July 26, 2024

Unfortunately, it's still the same.
its look it connect to 172.17.0.2:3000 and cant connect to backend. I use this Export command i rebuild docker but still have this problem.
I may use them incorrectly or something

from ambar.

deyraka avatar deyraka commented on July 26, 2024

THX
i build all but when docker start i have infinite loading screen and white board on localhost:82 in logs i dont see any errors. Anyone have similar problem ?

I've following the instruction above. Unfortunately, I face the same issue.
there are no problem while docker-compose up. But, when I open {ipAddress}:82 it's only show white blank page with "Loading..." title
What did I miss?

from ambar.

ark- avatar ark- commented on July 26, 2024

Unfortunately I cannot test as I have decided to stop using Ambar.

This is because 9 containers for document search is too many. Also ElasticSearch image seemed to always be using the CPU. I think Ambar was overkill for my purposes (home document scan search).

from ambar.

iddqd-dev avatar iddqd-dev commented on July 26, 2024

Unfortunately I cannot test as I have decided to stop using Ambar.

This is because 9 containers for document search is too many. Also ElasticSearch image seemed to always be using the CPU. I think Ambar was overkill for my purposes (home document scan search).

Of course, windows indexing does a great job of searching through less than a million documents.

from ambar.

deyraka avatar deyraka commented on July 26, 2024

THX
i build all but when docker start i have infinite loading screen and white board on localhost:82 in logs i dont see any errors. Anyone have similar problem ?

I've following the instruction above. Unfortunately, I face the same issue.
there are no problem while docker-compose up. But, when I open {ipAddress}:82 it's only show white blank page with "Loading..." title
What did I miss?

Hi, I think I found solution for my problem. Based on my trial in the last two days, I think the problem is the network config in docker-compose.yml.
When I tried the scenario to expose all service port to the host, frontend page appeared as it should. But, not when all service tried to connect each other via docker network.
It's good, finally the frontend page could be accessed. But, I'm sure that not a good choice to expose all the service port to the host which means our server would be more vulnerable from attacks.
Communication via docker network still being the best practice.
And then, I tried to modify docker-compose.yml by specifying network driver : bridge.

Voila, everything works good now.
Hopefully, this will help everyone who face the same issue

from ambar.

ropheefd avatar ropheefd commented on July 26, 2024

THX
i build all but when docker start i have infinite loading screen and white board on localhost:82 in logs i dont see any errors. Anyone have similar problem ?

I've following the instruction above. Unfortunately, I face the same issue.
there are no problem while docker-compose up. But, when I open {ipAddress}:82 it's only show white blank page with "Loading..." title
What did I miss?

Hi, I think I found solution for my problem. Based on my trial in the last two days, I think the problem is the network config in docker-compose.yml.
When I tried the scenario to expose all service port to the host, frontend page appeared as it should. But, not when all service tried to connect each other via docker network.
It's good, finally the frontend page could be accessed. But, I'm sure that not a good choice to expose all the service port to the host which means our server would be more vulnerable from attacks.
Communication via docker network still being the best practice.
And then, I tried to modify docker-compose.yml by specifying network driver : bridge.

Voila, everything works good now.
Hopefully, this will help everyone who face the same issue

I tried modifying docker-compose.yml with network driver: bridge, but I'm getting an error. Can you show your final docker-compose as I'm having the same issue as you are?

from ambar.

stale avatar stale commented on July 26, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from ambar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.