Skip to content

Instantly share code, notes, and snippets.

@fiveisprime
Last active February 5, 2018 23:04
Show Gist options
  • Save fiveisprime/63cd7bd93b60e2afc96a1f691e4fb4f3 to your computer and use it in GitHub Desktop.
Save fiveisprime/63cd7bd93b60e2afc96a1f691e4fb4f3 to your computer and use it in GitHub Desktop.
Angular custom image deployment to Azure
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
charset utf-8;
location / {
try_files $uri /index.html;
}
}
FROM nginx:stable-alpine
ADD dist /usr/share/nginx/html
ADD default.conf /etc/nginx/conf.d/
@fiveisprime
Copy link
Author

fiveisprime commented Feb 5, 2018

Creates a small image using nginx to serve a single page Angular app. Packages up the dist directory and will serve static assets if found and default to index.html (line 8 of default.conf)

Usage

  1. Copy default.conf and Dockerfile to the root of your project
  2. Run $ ng build --prod prior to building
  3. Build the image and deploy to Azure using the Docker extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment