DevOps Classroom notes 19/Jan/2024

Docker (Revision)

Acivity: Containerize nopCommerce

  • Create a Dockerfile for nopcommerce
FROM mcr.microsoft.com/dotnet/sdk:7.0
EXPOSE 5000
COPY ./nop/ /nop
WORKDIR /nop
CMD ["dotnet", "Nop.Web.dll", "--urls", "http://0.0.0.0:5000"]
  • run the container docker container run -d -P --name nop nop:1.0
  • now inspect the container and find ip address docker container inspect nop
  • lets create a nopdb volume docker volume create nopdb
  • Now lets create the mysql container with username nop password nop12345 database nop and root password nop12345 with /var/lib/mysql attached to nopdb volume
docker container run -d --name nopdb -v nopdb:/var/lib/mysql -e "MYSQL_ROOT_PASSWORD=nop12345" -e "MYSQL_USER=nop" -e "MYSQL_PASSWORD=nop12345" -e "MYSQL_DATABASE=nop" mysql:8.0-debian
  • inspect and find the ipaddress of nopdb
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%