Hosting an Angular app on Microsoft's NanoServer with IIS
151
The Angular source code is inside a folder named websrc. The websrc folder is inside the same folder where the Dockerfile resides.
Contents of the Dockerfile used:
# Indicates that the nanoserver image will be used as the base image
FROM microsoft/iis:nanoserver
# Metadata indicating an image maintainer
MAINTAINER @abelgaxiola
# Delete the default website files
RUN powershell -Command Remove-Item -Recurse C:\inetpub\wwwroot\*
# Copy the contents of websrc folder into the default website folder
COPY ./websrc c:/inetpub/wwwroot
# Sets a command or process to run each time a container is run from the new image
CMD [ "CMD" ]
Docker commands used:
docker build -t south-to-north . docker run -d --name south-to-north -p 80:80 south-to-north docker inspect --format '{{ .NetworkSettings.Networks.nat.IPAddress }}' south-to-north
The last command return the IP Address of the running image.
The website can now be viewed and interacted with by copying the IP Address into a web browser's address bar
Copy of the code source and Docker file are in GitHub here: Nano-Ng on GitHub
Content type
Image
Digest
Size
365.5 MB
Last updated
over 9 years ago
docker pull abelgaxiola/nano-ng:south-to-north