danwahlin / angular-docker-microservices Goto Github PK
View Code? Open in Web Editor NEWExample of serving an Angular app to the browser using nginx. App calls Node.js/MongoDB and ASP.NET Core/PostgreSQL microservices.
Example of serving an Angular app to the browser using nginx. App calls Node.js/MongoDB and ASP.NET Core/PostgreSQL microservices.
CONDITIONS:
Windows 10
ACTION
clone and follow the instructions
EXPECTED
after docker-compose up everything is up and running
ACTUAL
$ docker-compose up
postgres is up-to-date
mongodb is up-to-date
Recreating nginx ...
Recreating aspnetcoreapp ...
Recreating nodeapp ...
Recreating nginx ... done
Recreating aspnetcoreapp ... done
Recreating nodeapp ... done
ocker:/var/lib/docker"\nis not a valid Windows path'
ERROR: for cadvisor Cannot create container for service cadvisor: b'Mount denied:\nThe source path "\\var\\lib\\docker:/var/lib/docker"\nis not a valid Windows path'
ERROR: Encountered errors while bringing up the project.
Hi,
Is there a way that I could reuse node and angular from the containers in order develop the angular app?
I found here but I am not quite sure how to link it all together so that VC code can do code completion and all the checks.
Thank you in advance,
Michal
Hi Dan. I watched you giving a tutorial on youtube about the Docker and Angular. Thanks, that was awesome. I refer to it quite often. Now, that I come across Docker myself and try to containerize my app locally, I encounter some difficulties. Additionally, I am quite new in programming. Can you explain please how did you create an app_network that you used in the docker-compose.yml? I am having troubles proxying an api requests, since my backend container is working on different port. I configured Nginx, by adding upstream module but I get 502 Gateway issue. Although, all containers operate in the default network, I guess solution might be in creating a new app_network, like you probably did for your demo.
I'm attempting to use your nginx.conf to host an Angular PWA/service worker project via Docker.
What I'm finding is that the app does not properly leverage the service worker when hosting through my container.
When I follow the Angular docs to serve the app with http-server, the service worker properly intercepts the requests and serves the resources from the cache. I can also load the app when http-server is not running, once the service worker has previously cached the resources. So basically.. it's behaving exactly as I would expect a service worker to behave:
When I host the exact same service worker build through my Docker container/NGINX, however, the app behaves much differently:
Furthermore, when I take my container down, I can no longer load the app from the service worker's cache. The only real difference here is that I'm hosting through a Docker container, but more specifically, through NGINX.
So my question is: what changes do I need to make to my nginx.conf in order to make NGINX play nicely with a PWA/service worker setup?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.