Dockerized Websites

From SCECpedia
Jump to navigationJump to search

SCEC is dockerizing our websites and running them on commercial cloud services. Some of the technologies used are described below:


Docker usual case

  we use,

    >> docker image build  
        to build an image locally
    >> docker push 
        to save image to a remote repository
    >> docker run
        users can use saved image to
        run on their localhost in a container

Docker running multiple websites on moho

    >> docker-compose ... up -- build --force -d 
        to build image locally and start running the image 
        in a container in daemon(detached) mode

      (to shutdown that container  
        docker-compose ... down

    ... is a yml file that shows how the services
        ie. db and web are to be run  and which
        dockerfile to use to build the image for each service

    --> there is no saving of 'image' so other user
        can not reuse in this case

System Status on Moho

currently, moho has several containers running different web and db
services for each cxm web viewer.

CONTAINER ID   IMAGE         COMMAND                  CREATED        STATUS        PORTS                                                                              NAMES           SIZE
c4869b0941ca   egd_web_db    "docker-entrypoint.s…"   6 hours ago    Up 6 hours    0.0.0.0:5435->5432/tcp, :::5435->5432/tcp                                          egd_web_db_1    72.8MB (virtual 309MB)
73f0de92dcee   egd_web_web   "apachectl -D FOREGR…"   6 hours ago    Up 6 hours    0.0.0.0:8093->80/tcp, :::8093->80/tcp, 0.0.0.0:8092->8081/tcp, :::8092->8081/tcp   egd_web_web_1   35.3kB (virtual 682MB)
6daf0107a50a   csm_web_web   "apachectl -D FOREGR…"   3 days ago     Up 3 days     0.0.0.0:8097->80/tcp, :::8097->80/tcp, 0.0.0.0:8096->8081/tcp, :::8096->8081/tcp   csm_web_web_1   133kB (virtual 1.14GB)
8026bd377197   csm_web_db    "docker-entrypoint.s…"   3 days ago     Up 3 days     0.0.0.0:5437->5432/tcp, :::5437->5432/tcp                                          csm_web_db_1    5.51GB (virtual 15.2GB)
d061ee4e5773   cgm_web_db    "docker-entrypoint.s…"   4 months ago   Up 4 months   0.0.0.0:5433->5432/tcp, :::5433->5432/tcp                                          cgm_web_db_1    73MB (virtual 7.25GB)
2294dc654c59   cgm_web_web   "apachectl -D FOREGR…"   4 months ago   Up 4 months   0.0.0.0:8083->80/tcp, :::8083->80/tcp, 0.0.0.0:8082->8081/tcp, :::8082->8081/tcp   cgm_web_web_1   2.8MB (virtual 15GB)

SIZE column is => 'total file sizes'

moho is quite beefy right now. I think it is a T3.medium AWS node.
Can confirm with Edric.

https://aws.amazon.com/ec2/instance-types/

and moho has a big 500G disk space..

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           3.9G  876K  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/nvme0n1p1  500G  311G  190G  63% /
tmpfs           790M     0  790M   0% /run/user/1001


on moho, the dockerd is running as root and it manages the container running on it.

(base) [mei@ip-172-31-31-151 ~]$ ps -ef |grep docker
root      3807     1  0  2022 ?        10:15:03 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --default-ulimit nofile=32768:65536
root     10467  3807  0 Aug14 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5437 -container-ip 192.168.80.2 -container-port 5432
root     10473  3807  0 Aug14 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 5437 -container-ip 192.168.80.2 -container-port 5432
root     10487  3807  0 Aug14 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8097 -container-ip 192.168.80.3 -container-port 80
root     10494  3807  0 Aug14 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8097 -container-ip 192.168.80.3 -container-port 80
root     10531  3807  0 Aug14 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8096 -container-ip 192.168.80.3 -container-port 8081
root     10540  3807  0 Aug14 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8096 -container-ip 192.168.80.3 -container-port 8081
root     13214  3807  0 Apr07 ?        00:00:07 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5433 -container-ip 192.168.192.2 -container-port 5432
root     13220  3807  0 Apr07 ?        00:00:07 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 5433 -container-ip 192.168.192.2 -container-port 5432
root     13235  3807  0 Apr07 ?        00:00:12 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8082 -container-ip 192.168.192.3 -container-port 8081
root     13245  3807  0 Apr07 ?        00:00:07 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8082 -container-ip 192.168.192.3 -container-port 8081
root     13289  3807  0 Apr07 ?        00:00:07 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8083 -container-ip 192.168.192.3 -container-port 80
root     13295  3807  0 Apr07 ?        00:00:07 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8083 -container-ip 192.168.192.3 -container-port 80
root     30912  3807  0 Aug17 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5435 -container-ip 192.168.176.2 -container-port 5432
root     30917  3807  0 Aug17 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 5435 -container-ip 192.168.176.2 -container-port 5432
root     30930  3807  0 Aug17 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8092 -container-ip 192.168.176.3 -container-port 8081
root     30938  3807  0 Aug17 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8092 -container-ip 192.168.176.3 -container-port 8081
root     30977  3807  0 Aug17 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8093 -container-ip 192.168.176.3 -container-port 80
root     30990  3807  0 Aug17 ?        00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8093 -container-ip 192.168.176.3 -container-port 80