In one of my previous blog post, we learned, How to run SDL DXA theming inside Docker. Today we are going to run SDL DXA in Window Docker. It is really quick and easy. To learn more about my previous blog post click here.
Steps to setup you SDL DXA-WEBAPP in Docker
Steps to setup you SDL DXA-WEBAPP in Docker
- Download DXA latest version from SDL GITHUB account.
- Create a folder at any location, this path will be used as a physical location when you run the web-install.ps1.
- Go to the Root directory and create Dockerfile.
- Here, it is very important to understand that what all you need to have in your DockerFile. I faced couple of issues while I was working on this but managed to solve all of them.
- Once your SDL DXA is installed copy and paste below sample Dockerfile content in your file.
- Open PowerShell in Admin mode and navigate to root directory created in step 2.
- Run the following Docker commands.
- docker build -t sdldxaindocker . (refer ScreenShot 1)
- docker run -d --name sdldxaindockerimage sdldxaindocker (refer Screenshot 2)
- docker inspect -f "{{ NetworkSettings.Networks.nat.IPAddress }}" sdldxaindockerimage (refer ScreenShot 3)
- Last step set-TtmWebsite and update the -BaseUrls
FROM microsoft/aspnet
RUN New-Item c:\sdldxaindocker -type directory
WORKDIR /sdldxaindocker
COPY ./DXADOCKER/ .
RUN Remove-WebSite -Name 'Default Web Site'
RUN New-Website -Name 'DXADOCKER' -Port 80 -PhysicalPath 'c:\sdldxaindocker' -ApplicationPool '.NET v4.5'
Advantages of using Docker.
- You can connect your source code with docker and with this it will keep your code in-sync/updated with your Docker container and solve your CI problems.
- You can run this container on any platform.
- Automate your build and test pipelines and accelerate your software development.
- Minimum Infrastructure.
- Load-Balancing can be managed easily.
- Improve Efficiency of DevOps.
- Easy Distribution, share, and configuration of applications.
- Easy and real-time scaling of application
The output of your Docker commands.
ScreenShot 1 |
ScreenShot 2 |
Screenshot 3 |
Browse the URL http://172.24.179.102/
Happy coding and keep sharing !!!!
No comments:
Post a Comment