docker环境搭建
收集了一些组件的docker搭建方式
# mysql
version: '3'
services:
mysql:
restart: "no"
image: mysql:8.0.17
container_name: mysql
ports:
- "3306:3306"
environment:
TZ: Asiz:Shanghai
MYSQL_ROOT_PASSWORD: 1223
command: [
"--log-bin=mysql-bin",
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_unicode_ci",
"--innodb_flush_log_at_trx_commit=1",
"--sync_binlog=1"
]
volumes:
- ./mysql/data/lib:/var/lib/mysql
- ./mysql/data/conf:/etc/mysql/conf.d
# oracle
version: "2"
services:
orcl19c_03:
image: registry.cn-hangzhou.aliyuncs.com/zhuyijun/oracle:19c
restart: always
ports:
- "1524:1521"
- "5502:5500"
container_name: orcl19c_03
environment:
ORACLE_SID: ORCLCDB
ORACLE_PDB: ORCLPDB1
ORACLE_PWD: 123456
ORACLE_EDITION: standard
ORACLE_CHARACTERSET: AL32UTF8
volumes:
- ./data:/opt/oracle/oradata
# redis
version: '3'
services:
redis:
image: redis:5.0.5-alpine
restart: "no"
container_name: redis
ports:
- "6379:6379"
volumes:
- ./redis/data/conf/redis.conf:/usr/local/etc/redis/redis.conf
- ./redis/data/log:/var/log/redis
- ./redis/data/data:/data/redis
command: sh -c "redis-server /usr/local/etc/redis/redis.conf"
**配置文件 redis.conf **
port 6379
#不开启集群
cluster-enabled no
notify-keyspace-events Ex
#ms
cluster-node-timeout 15000
requirepass deepsignredispwd
#data目录
dir /data/redis/
protected-mode no
#log
logfile /var/log/redis/redis.log
# frp
version: "2"
services:
frps:
image: lhyan/frps:0.0.1
restart: always
container_name: frps
ports:
- "7000:7000"
- "7001:7001"
- "7500:7500"
- "7002-7010:7002-7010"
# nginx
version: "2"
services:
nginx:
image: registry.cn-hangzhou.aliyuncs.com/leihuangyan/nginx:ssl-fileauth
restart: always
container_name: nginx-ssl
ports:
- "8090:80"
- "443:443"
volumes:
- ./conf:/etc/nginx/conf.d/
- ./ssl:/ssl/
- ./html:/usr/share/nginx/html
- ./logs:/var/log/nginx
conf.d
server {
listen 80;
server_name default_server;
root html;
index index.html index.htm;
client_max_body_size 50M;
client_body_buffer_size 128k;
location / {
root /usr/share/nginx/html/dist;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
# SRS
version: "2"
services:
srs:
restart: "always"
container_name: srs
image: registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5
ports:
- "1935:1935"
- "1985:1985"
- "8080:8080"
- "8000:8000"
environment:
CANDIDATE: 8.218.186.155
# minio
version: '3'
services:
minio:
image: minio/minio
restart: "no"
container_name: minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./minio/data:/data
- ./minio/config:/root/.minio
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
command: server /data --console-address ":9001"
# gitlab
version: '3.6'
services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
environment:
TZ: 'Asia/Shanghai'
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://112.91.140.52:30080' # web站点访问地址
ports:
- '30080:30080' # 注意宿主机和容器内部的端口要一致,否则external_url无法访问
- '30443:443'
- '30022:22'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
shm_size: '2048m'
# kafka
version: '3'
services:
zookeeper:
image: 'bitnami/zookeeper:latest'
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: 'bitnami/kafka:latest'
ports:
- '9092:9092'
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://112.91.140.52:9092
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
depends_on:
- zookeeper
# es
version: '3'
services:
elk-es:
image: elasticsearch:7.8.0
container_name: elk-es
restart: always
environment:
# 开启内存锁定
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
# 指定单节点启动
- discovery.type=single-node
ulimits:
# 取消内存相关限制 用于开启内存锁定
memlock:
soft: -1
hard: -1
volumes:
- ./data:/usr/share/elasticsearch/data
- ./logs:/usr/share/elasticsearch/logs
- ./plugins:/usr/share/elasticsearch/plugins
ports:
- 9200:9200
kibana:
image: kibana:7.8.0
container_name: elk-kibana
restart: always
environment:
ELASTICSEARCH_HOSTS: http://elk-es:9200
I18N_LOCALE: zh-CN
ports:
- 5601:5601
上次更新: 2024/11/05, 08:29:31