linux deployment software configuration details using ES1en ES2en
- 2020-12-18 02:02:28
- OfStack
preface
This article will share some of the docker-ES4en configurations, and you can refer to their summary of their docker-based development/production environment configurations. Without further ado, let's take a look at the details
Install docker and ES9en-ES10en
install docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
install docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Create a dedicated network
docker network is used to create its own dedicated common network, me_gateway, so that docker's software can access each other
docker network create me_gateway
docker - Traefik compose deployment
1 reverse proxy server, it is very fast, automatic discovery service, automatic application https and other great features, project address, Chinese documents.
]
docker-compose.yml
This is an example of an ES51en-ES52en.yml configuration using traefik
Where the mounted./ traefik. toml is configured for it,
The mounted ES62en.json is the configuration of Let 's Encrypt
version: '3'
version: '3'
services:
me_traefik:
image: traefik:1.7.4
container_name: me_traefik
ports:
- '80:80'
- '443:443'
- '8090:8090'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
networks:
- webgateway
networks:
webgateway:
external:
name: me_gateway
traefik.toml
Configuration details: http: / / docs traefik. cn/toml # acme - lets encrypt -- configuration
Here is an example of some of the problems encountered in configuring validation, please refer to the following configuration or comments in this article
################################################################
# Global configuration
################################################################
# Enable debug mode
#
# Optional
# Default: false
#
debug = false
# Log level
#
# Optional
# Default: "ERROR"
#
logLevel = "ERROR"
# Entrypoints to be used by frontends that do not specify any entrypoint.
# Each frontend can specify its own entrypoints.
#
# Optional
# Default: ["http"]
#
defaultEntryPoints = ["http","https"]
################################################################
# Entrypoints configuration
################################################################
# Entrypoints definition
#
# Optional
# Default:
# for 1 Enable basic authentication at all entry points ( basic auth )
# use 2 Set the user name / password : test:test with test2:test2
# The password can be MD5 , SHA1 or BCrypt Method encryption: You can use it htpasswd To generate these usernames and passwords.
# [entryPoints]
# [entryPoints.http]
# address = ":80"
# [entryPoints.http.auth.basic]
# users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/", "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"]
#
# for 1 Enable Summary authentication at all entry points ( digest auth )
# use 2 Set the user name / The domain / Password: test:traefik:test with test2:traefik:test2
# You can use htdigest To generate these user names / The domain / password
[entryPoints]
[entryPoints.http]
address = ":80"
# [entryPoints.http.redirect]
# entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[entryPoints.webentry]
address = ":8090"
[entryPoints.webentry.auth]
[entryPoints.webentry.auth.basic]
users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"]
################################################################
# API and dashboard configuration
################################################################
# Enable API and dashboard
[api]
dashboard = true
entrypoint = "webentry"
################################################################
# Ping configuration
################################################################
# Enable ping
[ping]
# Name of the related entry point
#
# Optional
# Default: "traefik"
#
# entryPoint = "traefik"
################################################################
# Docker The backend configuration
################################################################
# Use the default domain name.
# You can do this by setting it up for the container "traefik.domain" label To cover.
# To enable the Docker The backend configuration
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "yimo.link"
watch = true
exposedByDefault = false
usebindportip = true
swarmMode = false
network = "me_gateway"
[acme]
email = "yimo666666@qq.com"
storage = "acme.json"
entryPoint = "https"
onDemand = false
onHostRule = true
[acme.httpChallenge]
entryPoint="http"
docker-compose deploys Gogs and binds the domain name with traefik
You can refer to this configuration if you want to start building with mysql 1
docker-compose.yml
version: '3'
services:
me_gogs:
restart: always
image: gogs/gogs
container_name: me_gogs
volumes:
- ./data:/data
- ./logs:/app/gogs/log
ports:
- '10022:22'
- '10080:3000'
labels:
- 'traefik.backend=me_gogs'
- 'traefik.frontend.rule=Host:git.yimo.link'
- 'traefik.enable=true'
- 'traefik.protocol=http'
- 'traefik.port=3000'
networks:
- webgateway
networks:
webgateway:
external:
name: me_gateway
To initialize, you need to set the domain to either 0.0.0.0 or git.yimo.link
The. / data/gogs/conf/app ini for
DOMAIN = git.yimo.link
docker - mysql compose deployment
It is worth mentioning that with the 1 network, you can directly use me_mysql connection
docker-compose.yml
version: '3'
services:
me_mysql:
image: mysql:5.7.21
container_name: me_mysql
volumes:
- ./data:/var/lib/mysql
ports:
- '3306:3306'
environment:
- MYSQL_ROOT_PASSWORD=root
networks:
- webgateway
networks:
webgateway:
external:
name: me_gateway
conclusion