Reputation: 6097
I'm using a Digital Ocean droplet + Dokku (Docker) and I'm curious about the best way to deploy an Angular app.
Angular apps are static files. What are the recommended and/or easiest ways to setup a server to serve them (on Dokku + VPS)?
I've seen a number of ways floated on blogs but thought asking here might be helpful in getting ideas and generating knowledge that will help other programmers.
Upvotes: 4
Views: 2470
Reputation: 1
Create 1 more file call composer.json
with content {}
in root directory,
then push to dokku, now you can serve your in static.
Upvotes: 0
Reputation: 2442
I think your question has quite a broad scope that's not just limited to Dokku / Angular but applies to the deployment of any application using static assets.
I would suggest starting with the 12 Factor App (http://12factor.net/) methodology and also reading Heroku's implementation of this methodology in the form of a gem (https://github.com/heroku/rails_12factor), particularly the section under serving static files. While you might not be writing a Rails app it applies to any application.
In summary of the gems README.md, your app should be responsible for serving the static files directly (without the help of Nginx or other web server) then rely on a CDN to distribute the files for fast access.
Upvotes: 4