Featured post

Docker setup for Liferay 7 with MySQL

Wednesday 5 April 2017

Docker setup for Liferay 7 with SMTP, document library and more as Part II

In my previous blog we talked about setting up docker with Liferay and MySQL!


In this blog we will integrate SMTP server inside docker and setup mount for document_library.
We will go through content of Dockerfile which we cloned from repo and made necessary changes.

Few terms we need to understand before jumping to the setup

Dockerfile : Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession.


Volume : data volume is a specially-designated directory within one or more containers that bypasses the Union File System.

Mount : A mount point is a directory in a file system where additional information is logically connected  from a storage location outside the operating system’s root drive and partition.

Cool, Let's move forward and have a look on docker-compose.yml


version: '2'
services:
  portal:
    build: .
    ports:
     - "8080:8080"
     - "11311:11311"
    environment:
      - MYSQL_ROOT_PASSWORD=my-secret-pw
      - MYSQL_DATABASE=lportal
      - MAIL_SERVER=mail-server
      - MAIL_SERVER_SMTP_PORT=25
      - MAIL_SERVER_USER_FROM=admin@mail.vipin.org
      - MAIL_SERVER_USER_FROM_PASSWORD=admin
      - MAIL_SERVER_AUTH=true
    volumes:
    - "./data/deploy:/usr/local/liferay-ce-portal-7.0-ga3/deploy"
    - "./data/document_library:/usr/local/liferay-ce-portal-7.0-ga3/data/document_library"
    depends_on:
     - mysql
     - mail-server
  mail-server:
    image: million12/citadel
    ports:
      - "25:25"
      - "110:110"
      - "143:143"
      - "465:465"
      - "587:587"
      - "993:993"
      - "995:995"
      - "9090:8080"
      - "10022:22"
    environment:
      - ROOT_PASS=root
      - PASSWORD=admin
      - DOMAIN=vipin.org
    hostname: mail.vipin.org
  mysql:
    image: mdelapenya/mysql-utf8
    ports:
     - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=my-secret-pw
      - MYSQL_DATABASE=lportal
      - character-set-server=utf8mb4
      - collation-server=utf8mb4_unicode_ci

This is the same file which we used earlier with addition of mail server setup and mounting document library.

SMTP

We are using million12/citadel repository for SMTP server. There are so may smtp server available in docker hub but this is a easy one with web ui and authentication support.

As you can see in yml file we have added one more dependency service mail-server.  We have exposed ports for smtp, ssl, web ui etc. hostname is your mail extension here.
So you create a user inside smtp server with web support which is available on port 9090, e.g. 192.168.99.100:9090

You can login as admin/admin for administrator account or create user from outside with Register New User link, e.g. vipin.bardia@mail.vipin.org.
Use the same user and create that account in Liferay portal and check on the same mail id if you get a welcome mail like this or not.



Amazing, now you have your own SMTP server with few lines of configuration :)

Document Library

Let's talk about Volume and Mount again. I've already shared there definition above so will go through the use of it in our case.

Let's say I want to move my server to somewhere else, what is required other than database?
It's my documents which is stored in data/document_library folder.

So what can I do about this?

- "./data/deploy:/usr/local/liferay-ce-portal-7.0-ga3/deploy"
- "./data/document_library:/usr/local/liferay-ce-portal-7.0-ga3/data/document_library"

As you can see here ./data/document_library  is my local folder where [.]  represents current directory and /usr/local/liferay-ce-portal-7.0-ga3/data/document_library is my document library folder which is separated by [:] this line creates a volume inside docker container and mount it our local folder.

Whenever we upload anything like this in Liferay


It will be synced to our local folder like this

In the same manner we mount deploy folder and as soon as we drop the file war/jar inside it, it is copied to volume deploy folder and starts deployment.


Dockerfile: These are instruction which is executed step by step to create a new image.


FROM mdelapenya/liferay-portal:7-ce-ga3-tomcat-hsql
MAINTAINER Manuel de la Peña <manuel.delapenya@liferay.com>

COPY ./configs/portal-ext.properties $LIFERAY_HOME/portal-ext.properties

ENTRYPOINT ["catalina.sh", "run"]


  1. Fetch image from repository
  2. Information about Maintainer
  3. Copy portal-ext to docker image at specified path
  4. $LIFERAY_HOME is environment variable
  5. Entrypoint will execute catalina


You are just done, Try & Enjoy the function.............:)

49 comments:

  1. This is only the data I am discovering all over the place. A debt of gratitude is in order for your website, I simply subscribe your online journal. This is a decent blog.. dokument

    ReplyDelete
  2. Nice article, which you have described very well about the service. Your article is very useful for those who are looking to SMTP Server for Bulk Email at the affordable price. thanks for sharing...

    ReplyDelete
  3. There are so many different types of pallet jacks to choose from it can be tricky but should you decide to opt for the Yale manual pallet jack to get your potential empire off the ground. A comfort with these and other top brands such as;  Online Docker Training

    ReplyDelete
  4. Some truly wonderful work on behalf of the owner of this internet site , perfectly great articles .
    Real Weed For Sale

    ReplyDelete
  5. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. internal audit tracking software

    ReplyDelete
  6. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you.
    oxycodone hcl

    ReplyDelete
  7. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. mapsjar.com

    ReplyDelete
  8. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. click here

    ReplyDelete
  9. I would like to say that this blog really convinced me to do it! Thanks, very good post. online business listings management

    ReplyDelete
  10. https://k2incenseonlineheadshop.com/
    info@k2incenseonlineheadshop.com
    Buy liquid incense cheap
    Buy liquid incense cheap For Sale At The Best Incense Online Shop
    K2 Spice Spray | Liquid K2 | Liquid Spice | K2 Spray for sale

    ReplyDelete
  11. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. Financial management

    ReplyDelete
  12. Both of these weed eater blades are effective and fairly inexpensive. The plastic blades can be break easily, particularly if it is ground up against the driveway. buy weed online

    ReplyDelete
  13. This blog was extremely helpfull. I really appreciate your kindness in sharing this with me and everyone else!
    ice o lator

    ReplyDelete
  14. Excellent and very exciting site. Love to watch. Keep Rocking. https://www.sacstart.org

    ReplyDelete
  15. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. IT support London

    ReplyDelete
  16. Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read. IT consultancy London

    ReplyDelete
  17. It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. Mortgages

    ReplyDelete
  18. This is a good post. This post gives truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. Thank you so much. Keep up the good works. renew mortgage

    ReplyDelete
  19. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. Mortgages

    ReplyDelete
  20. Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read. renew mortgage

    ReplyDelete
  21. It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. IT support London

    ReplyDelete
  22. This is a good post. This post gives truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. Thank you so much. Keep up the good works. IT consultancy London

    ReplyDelete
  23. marijuana has been a stepping stone to the medical condition of most patients.
    many people suffering from cancer, chronic pain, anxiety, and many more have overcome their aillment with cannabis.
    you can order weed from our store.medical condition

    ReplyDelete
  24. It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. Alcoholics Anonymous

    ReplyDelete
  25. You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! Alternative Funding

    ReplyDelete
  26. I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! Business Capital Loans

    ReplyDelete
  27. I'm glad to see the great detail here!. AA Meeting

    ReplyDelete
  28. I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article. rebrand

    ReplyDelete
  29. I loved your blog post. Really looking forward to read more.
    Transfer large files

    ReplyDelete
  30. I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! US Business Funding

    ReplyDelete
  31. Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!! Merchant Cash Advance

    ReplyDelete
  32. Don't let anxiety cause you to develop phobias or false deceptions in your life. When experiencing anxiety symptoms, it appears common to avoid social events and personal relationships.https://www.researchchemslab.com/

    ReplyDelete
  33. Buy Meth Online. Crystal mеth iѕ the common name fоr сrуѕtаl methamphetamine, a ѕtrоng аnd highly addictive drug that affects the central nеrvоuѕ ѕуѕtеmhttps://refinedresearchchemstore.com/index.php/product/buy-crystal-meth-online/

    ReplyDelete
  34. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. Houston Texas business loans

    ReplyDelete
  35. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. cannabusiness loan

    ReplyDelete
  36. I exactly got what you mean, thanks for posting. And, I am too much happy to find this website on the world of Google. cannabis business loan

    ReplyDelete
  37. Opening a California medical marijuana dispensary means that you have done your homework and know what it takes to open the dispensary according to the laws of your state. 420

    ReplyDelete
  38. Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards,
    Order Adderall 30mg Online

    ReplyDelete
  39. Hi, I appreciate your speculating as it arouses people’s concern today and lets this topic be discussable. We all know about it here.Best Mortgage Rate in Burlington

    ReplyDelete
  40. A considerable lot of them are likewise furnished with OCR highlight and in this caring you can make an editable text out of filtered PDF records. PDF to PNG

    ReplyDelete