If you are just trying to create a container for you angular2 app here are some steps to help: Create your angular2 app with angular-cli if you don`t have one and build it(with aot) ng build --prod --aot It will create the dist directory Create the nginx file: default.conf It will have the caching and capture all locations to your index(as expected in a single page app) server {listen 80; charset utf-8; sendfile on; root /usr/share/nginx/html; Gzip Settings gzip on;gzip_http_version 1.1;gzip_disable "MSIE [1-6]\.";gzip_min_length 1100;gzip_vary on;gzip_proxied expired no-cache no-store private auth;gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;gzip_comp_level 9; #Caches static assetslocation ~ ^/(assets|bower_components|scripts|styles|views) {expires 31d;add_header Cache-Control public;} #Caches Bundles created by angular clilocation ~* \.(?:bundle.js|bundle.css) {expires 1M;access_log off;add_header Cache-Control "public";} $ Main file index.html sending not found locations to the main location / {expires -1;add_header Pragma "no-cache";add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; try\_files **$**uri **$**uri/ /index.html = 404; }} Create a Dockerfile to build you image: #alpine image nginx:alpine#create the server and location configuration default.conf **/ / / /**default.conf#copies the build app to the default location dist **/ / / /**html FROM COPY etc nginx conf.d COPY usr share nginx If you try to run this will take a long time… because sends a lot of files to build de container, so you have to create a that only send the required files docker build docker .dockerignore *!dist!default.conf That’s a lot better! Now if you want to use kubernetes just create an yaml with the required properties: v1 Service webapp webapp NodePort - 80 80 TCP http apiVersion: kind: metadata:name: labels:run: spec:type: ports: port: targetPort: protocol: name: 443 TCP https webapp--- extensions/v1beta1 Deployment webapp 1 webapp - webapp [username]/[image]:[version] - 80- 443 - myregistrykey port: protocol: name: selector:run: apiVersion: kind: metadata:name: spec:replicas: template:metadata:labels:run: spec:containers: name: image: ports: containerPort: containerPort: imagePullSecrets: name: Hope it helps.. is how hackers start their afternoons. We’re a part of the family. We are now and happy to opportunities. Hacker Noon @AMI accepting submissions discuss advertising &sponsorship To learn more, , , or simply, read our about page like/message us on Facebook tweet/DM @HackerNoon. If you enjoyed this story, we recommend reading our and . Until next time, don’t take the realities of the world for granted! latest tech stories trending tech stories