Print
Category: My linux experience
Hits: 874
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

spider web with water beads network dewdrop1We develop a web-site using docker. Well, using docker-compose. So we have it working at our localhosts per team member, but we need run the docker at a real server under a real domain.

My server uses CentOS and CWP(CentOS Web Panel, Pro version). Usually a create a user, domain/subdomain/database. Then upload my web-site files, edit database credentials in the web-site config etc.

Docker wokrs in other way. So to run my docker-based project at my CWP-powered server I did the following.

The idea is easy. Run docker (I did via terminal) and in CWP assign proxy to my domain and point it to the docker web-server port.

 

  1. Install latest docker and docker-compose. https://docs.docker.com/compose/install/
  2. I also followed this additional docker setup, which I think was not needed. So omit it till you get in trouble.  https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting .
  3. Create a user, allow many processes for it.

    b_350_0_16777215_00_images_x_2019_01_11_04_38_21_cb.jpeg

  4. Establish a proxy, which will point domain calls to your server to you docker instance. My docker web-server is running at port 8000, so at localhost I visit the development site like localhost:8000.
    • Go to WebServer Settings -> WebServer Domain Conf and select your domain
      b_350_0_16777215_00_images_x_2019_01_11_04_53_39_uo.jpeg
    • Select proxy and enter your docker server port
      b_350_0_16777215_00_images_x_2019_01_11_05_01_19_qk.jpeg
  5. Establish my docker project and run it.

    I did the following:

    • Logged in into my new account(I use non-standard port for SSH): ssh mynewuser@my.domain.com -p 1234
    • Cloned my project from git like git clone git@gitlab.com:myproject/coolprg.git . You may just upload your files. My code is in coolprg folder. So I cd coolprg
    • Run my docker-compose up and wait till docker is up and running.
  6. So visiting your domain should should open your docker web-site now.

 

Found a typo? Please select it and press Ctrl + Enter.
FaLang translation system by Faboba