Detailed process analysis of docker deployment of snail cinema system

Detailed process analysis of docker deployment of snail cinema system

Environmental Statement

  • Host OS: Cetnos7.9 Minimum installation
  • docker Version: 20.10.6
  • System requirements: CPU 2 cores or above, 8G memory

If the number of CPU cores is less than 2, the theater will not be able to log in

  • mysql database: mysql5.6 container
  • redis database: redis4.0 container

Install centos7.9

First stop the firewall and turn off SELinux

Check the firewall status

firewall-cmd --state
# or systemctl status firewalld.service

Stop the firewall

systemctl stop firewalld.service

Disable firewall startup

systemctl disable firewalld.service

Permanently disable selinux (optional)

Enter the /etc/selinux/config file

vi /etc/selinux/config

Change SELINUX=enforcing to SELINUX=disabled

Disable SELinux service

setenforce 0

Check SELinux status

sestatus

Install dependency packages

# Install redhat-lsb
yum install -y redhat-lsb
# Install yum-config-manager, otherwise it will report: yum-config-manager: command not found yum -y install yum-utils
# Snail Ticketing depends on net-tools
yum install net-tools -y

Install Docker on CentOS 7.9

# Configure aliyun's docker installation source yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Install Docker dependencies

yum install -y yum-utils device-mapper-persistent-data lvm2

Check the docker version in the installation source

yum list docker-ce --showduplicates | sort -r

Install the latest version of Docker (20.10.6)

yum install docker-ce -y

Check the Docker version

docker version

Configure Docker image aliyun accelerator

# Create the /etc/docker directory mkdir -p /etc/docker

#Edit and create daemon.json
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://isdp30x2.mirror.aliyuncs.com"]
}
EOF

Restart the Docker daemon

# Restart the daemon process sudo systemctl daemon-reload
# Restart the docker service sudo systemctl restart docker 
# Set Docker to start automatically at boot systemctl enable docker

Deploy redis in docker

Create a local mount directory

mkdir /data/redis/{conf,data} -p

Create a redis container

# First enter the /data/redis/directory cd /data/redis

# Create and run a container named myredis docker run -itd --name myredis \
-p 6379:6379 \
-v /data/redis/data:/data \
--restart always redis --appendonly yes --requirepass "123456"

# Parameter explanation -d -> Start the container as a daemon -p 6379:6379 -> Bind to host port, 6379 host port, 6379 container port --name myredis -> Specify container name --restart always -> Start at boot# --privileged=true -> Increase permissions in the container --requirepass -> Set login password -v /data/redis/data:/data -> Map data directory --appendonly yes -> Enable data persistence

Docker deployment of mysql5.6

Docker runs mysql and persists data

Pull the mysql5.6 image:

docker pull mysql:5.6

Create a mysql local data storage mapping directory:

#MySQL's default data directory is /var/lib/mysql/
#Configure foldersudo mkdir -p /data/mysql/conf
## Create a persistent data folder for mysql data sudo mkdir -p /data/mysql/data
## Create a mysql log folder sudo mkdir -p /data/mysql/logs

## Create mkdir /data/mysql/{conf,data,logs} -p at one time

Running the MySQL container

docker run -dti -p 3306:3306 --name mysql56 -v /data/mysql/conf:/etc/mysql/conf.d -v /data/mysql/logs:/logs -v /data/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Woniu123 --restart=always mysql:5.6

Use navicat to connect to the database, restore the database character encoding to utf8mb4 , and sort by default

insert image description here

Install jdk8 on the host

1. Download JDK8 from the official website

Address: http://www.oracle.com/technetwork/articles/javase/index-jsp-138363.html

Select the corresponding .gz package to download

2. Unzip and put it in the specified directory (take jdk-7u60-linux-x64.gz as an example)

Create a directory:

sudo mkdir /usr/lib/jvm

Unzip to the specified directory:

 sudo tar -zxvf jdk-7u60-linux-x64.gz -C /usr/lib/jvm

3. Modify environment variables:

sudo vim ~/.bashrc

Append the following to the end of the file:

#set oracle jdk environment

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60 ## Note that the directory should be changed to the JDK directory you unzipped export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH

Make the environment variable take effect immediately

 source ~/.bashrc

Check whether jdk is effective

# View the java main program directory which java
# Check the java version java -version

Upload the server program qianyao directory to the host machine's /opt directory

Start the Cinema Server

cd /opt/qianyao
# Start the server./qianyao.sh start all
# Wait for all 10 service programs to start, which takes about two minutes 

insert image description here

Testing Process

  • Backstage
  • New Cinema
  • New screening room
  • Add Movies
  • Search Movies
  • Buy movie tickets
  • Payment

The above is the detailed content of the detailed process analysis of the docker deployment of the snail cinema system. For more information about docker deployment of snail, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • How to build a docker local image warehouse under centos7 system
  • Detailed explanation of Docker container basic system image packaging
  • Detailed explanation of how to mount the file system in a running Docker container

<<:  MySQL data table partitioning strategy and advantages and disadvantages analysis

>>:  100-1% of the content on the website is navigation

Recommend

25 fresh useful icon sets for download abroad

1. E-Commerce Icons 2. Icon Sweets 2 3. Mobile Ph...

MySQL8 Installer version graphic tutorial

Installation The required documents are provided ...

Detailed installation process of MySQL5.6.40 under CentOS7 64

MySQL5.6.40 installation process under CentOS7 64...

CSS draw a lollipop example code

Background: Make a little progress every day, acc...

How to redirect PC address to mobile address in Vue

Requirements: The PC side and the mobile side are...

jQuery realizes the picture following effect

This article shares the specific code of jQuery t...

About the problems of congruence and inequality, equality and inequality in JS

Table of contents Congruent and Incongruent congr...

How to find and delete duplicate rows in MySQL

Table of contents 1. How to find duplicate rows 2...

How to use Vue3 to achieve a magnifying glass effect example

Table of contents Preface 1. The significance of ...

MySQL 5.7.23 installation and configuration graphic tutorial

This article records the detailed installation pr...

Sample code for JS album image shaking and enlarging display effect

The previous article introduced how to achieve a ...

JavaScript BOM Explained

Table of contents 1. BOM Introduction 1. JavaScri...

Detailed explanation of CSS3 Flex elastic layout example code

1. Basic Concepts //Any container can be specifie...