web service diagram


Web service diagram

With the Docker class, I tried to set “Docker, AWS(Server, RDB), Jenkins”.
Web service

  1. Install EC2 instance and connect the server via SSH.
    Instance
  2. Install Jupyter Notebook (Default port : 8888)
  3. Install https using Openssl
  4. run jupyter
    sudo systemctl daemon-reload
    sudo systemctl enable jupyter
    sudo systemctl start jupyter
    sudo systemctl status jupyer
    
  5. Install docker
    sudo apt-update
    sudo apt install apt-transport-https
    sudo apt install ca-certificates
    sudo apt install curl
    sudo apt install software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
    sudo apt update
    apt-cache policy docker-ce
    sudo apt install docker-ce
    sudo systemctl status docker // check docker is running fine.
    
  6. Create Database(MySQL 5.6) on Amazon RDS
    MySQLCreation

  7. Check the inbound rule on Amazon to allow the port 3306 and connection check

  8. Create repository on Github
    GitRepository
    git clone https://github.com/LED74/Docker-Practice.git
    
  9. Create a dockerfile
    FROM ubuntu:18.04
    MAINTAINER Euido LEE <leeeuido@gmail.com>
    # Avoiding user interaction with tzdata
    ENV DEBIAN_FRONTEND=noninteractive
    RUN apt-get update
    RUN apt-get install -y apache2 # Install Apache web server (Only 'yes')
    RUN apt-get install -y software-properties-common
    RUN add-apt-repository ppa:ondrej/php # For Installing PHP 5.6
    RUN apt-get update
    RUN apt-get install -y php5.6
    # Connect PHP & MySQL
    RUN apt-get install -y php5.6-mysql
    EXPOSE 80
    CMD ["apachectl", "-D", "FOREGROUND"]
    
  10. Create a index.php and README.md file
    git add .
    git commit -m "First project configulation"
    git push
    
  11. Create a repository on Dockerhub and connect with Github
    DockerHub

  12. Install Jenkins on the EC2 Server.
    docker pull Jenkins
    docker run -d -p 8080:8080 -v /home/jenkins/:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -u root jenkins
    docker ps -a
    
    • Add 8080 port to the inbound rule of the EC2 Server.
    • Complete initial setting of Jenkins
  13. Install docker in the Jenkins container
    docker exec -it 0fdfae20341b /bin/bash
    curl -fsSLO https://get.docker.com/builds/Linux/x86_64/docker-17.04.0-ce.tgz
    tar xzvf docker-17.04.0-ce.tgz
    mv docker/docker/ /usr/local/bin
    docker login
    cd /home
    git clone https://github.com/LED74/Docker-Practice.git
    
  14. Fill in the Execete shell on the Jenkins
    cd /home/Docker-Practice
    git pull
    docker rm -f php || true
    docker pull leeeuido/docker-practice
    docker run -p 80:80 -v /home/Docker-Practice/Project:/var/www/html --name php leeeuido/docker-practice
    





© 2017. by isme2n

Powered by aiden