I have an AngularJS app that has this structure:
app/
----- controllers/
---------- mainController.js
---------- otherController.js
----- directives/
---------- mainDirective.js
---------- otherDirective.js
----- services/
---------- userService.js
---------- itemService.js
----- js/
---------- bootstrap.js
---------- jquery.js
----- app.js
views/
----- mainView.html
----- otherView.html
----- index.html
How do I go about creating my own image out of this and running it on a container? I've tried running it with no success with a Dockerfile and I'm relatively new to Docker so apologies if this is simple. I just want to run it on a http server (using nginx perhaps?)
I've tried these for help, to no success:
First of all, follow this best practice guide to build your angular app structure. The index.html should be placed in the root folder. I am not sure if the following steps will work, if it's not there.
To use a nginx, you can follow this small tutorial: Dockerized Angular app with nginx
1.Create a Dockerfile in the root folder of your app (next to your index.html)
FROM nginx
COPY ./ /usr/share/nginx/html
EXPOSE 80
2.Run docker build -t my-angular-app .
in the folder of your Dockerfile.
3.docker run -p 80:80 -d my-angular-app
and then you can access your app http://localhost