Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support angular 5 hosted with nginx #103

Closed
Granga opened this issue May 14, 2018 · 2 comments
Closed

Support angular 5 hosted with nginx #103

Granga opened this issue May 14, 2018 · 2 comments
Labels

Comments

@Granga
Copy link

Granga commented May 14, 2018

My application is consisted of angular 5 client, nodejs api, mongo db, and nginx.

From my understanding, I should include my angular dist files in the nginx image, but I'm not sure.

What is the most suitable way to include my angular 5 dist files?

@philtrep
Copy link
Member

philtrep commented May 14, 2018

Hey @Granga ,

There are 2 approaches I'd recommend. Note that building your entire application in NoDock is the best option for simplicity's sake and environment consistency.

Frontend Development Inside NoDock

If you're using a task runner/bundler for your client app and you want to run it within NoDock, the simplest option is to mount the source files in the workspace service (add a volume in the docker-compose.yml).

Expose the port your bundler/task runner uses to serve the files in development.

Add a reverse proxy on the existing NGINX site config.

You can then run the client manually inside the workspace container

docker-compose exec workspace npm install
docker-compose exec workspace npm run dev # or whatever the build command is

Frontend Development Outside NoDock

Essentially what you said, simply mount a volume on the nginx service that points to the dist folder on your host and modify the NGINX configuration to serve it.

I hope this helps and do let me know how it goes! 🚀

@Granga
Copy link
Author

Granga commented May 17, 2018

I went with the second option for now, because of how my environment is setup.

Thank you.

@Granga Granga closed this as completed May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants