Docker 重要软件安装和使用记录

3 minute

docker

 1############################# INSTALL ###################################
 2
 3# op1. apt
 4apt install docker.io -y && apt install docker-compose -y
 5
 6# op2. yum
 7# yum install -y yum-utils device-mapper-persistent-data lvm2
 8yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
 9yum install docker-ce
10curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
11chmod +x /usr/local/bin/docker-compose
12ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
13
14############################# START #####################################
15
16systemctl start docker && systemctl enable docker
17
18############################## MIRROR ##################################
19
20vi /etc/docker/daemon.json
21
22{
23  "registry-mirrors": [
24          "https://docker.mirrors.ustc.edu.cn",
25          "http://hub-mirror.c.163.com",
26          "https://registry.docker-cn.com"
27  ]
28}
29
30systemctl restart docker

weaviate

 1version: '3.4'
 2services:
 3  weaviate:
 4    command:
 5    - --host
 6    - 0.0.0.0
 7    - --port
 8    - '8080'
 9    - --scheme
10    - http
11    image: cr.weaviate.io/semitechnologies/weaviate:1.25.10
12    ports:
13    - 8080:8080
14    - 50051:50051
15    restart: on-failure:0
16    environment:
17      OPENAI_APIKEY: $OPENAI_APIKEY
18      QUERY_DEFAULTS_LIMIT: 25
19      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
20      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
21      DEFAULT_VECTORIZER_MODULE: 'text2vec-openai'
22      ENABLE_MODULES: 'text2vec-openai,generative-openai'
23      CLUSTER_HOSTNAME: 'node1'

webdav

 1version: '3'
 2services:
 3  webdav:
 4    image: bytemark/webdav
 5    restart: unless-stopped
 6    ports:
 7      - "8099:80"
 8    environment:
 9      AUTH_TYPE: Basic
10      USERNAME: ${WEBDAV_USERNAME}
11      PASSWORD: ${WEBDAV_PASSWORD}
12    volumes:
13      - ./data/:/var/lib/dav

alist

 1version: '3.3'
 2services:
 3    alist:
 4        image: 'xhofe/alist:latest'
 5        container_name: alist
 6        volumes:
 7            - './data:/opt/alist/data'
 8        ports:
 9            - '5244:5244'
10        environment:
11            - PUID=0
12            - PGID=0
13            - UMASK=022
14        restart: always

it-tools

1docker run -d --name it-tools --restart unless-stopped -p 8080:80 corentinth/it-tools:latest

kafka-zookeeper

 1version: '2.1'
 2
 3services:
 4  zoo1:
 5    image: zookeeper:3.4.9
 6    hostname: zoo1
 7    ports:
 8      - "2181:2181"
 9    environment:
10      ZOO_MY_ID: 1
11      ZOO_PORT: 2181
12      ZOO_SERVERS: server.1=zoo1:2888:3888
13    volumes:
14      - ./zk-single-kafka-single/zoo1/data:/data
15      - ./zk-single-kafka-single/zoo1/datalog:/datalog
16
17  kafka1:
18    image: confluentinc/cp-kafka:5.3.1
19    hostname: kafka1
20    ports:
21      - "9092:9092"
22    environment:
23      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
24      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
25      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
26      KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
27      KAFKA_BROKER_ID: 1
28      KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
29      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
30
31    volumes:
32      - ./zk-single-kafka-single/kafka1/data:/var/lib/kafka/data
33    depends_on:
34      - zoo1

freshrss

 1version: "3"
 2
 3services:
 4  freshrss:
 5    image: freshrss/freshrss:latest
 6    container_name: freshrss
 7    restart: unless-stopped
 8    logging:
 9      options:
10        max-size: 10m
11    volumes:
12      - ./data:/var/www/FreshRSS/data
13      - ./extensions:/var/www/FreshRSS/extensions
14    ports:
15      - "88:80"
16    environment:
17      TZ: "Asia/Shanghai"
18      CRON_MIN: "3,33"

mysql

 1version: "3"
 2
 3services:
 4  mysql:
 5    image: mysql:8
 6    container_name: mysql
 7    restart: unless-stopped
 8    ports:
 9      - ${DB_PORT}:3306
10    environment:
11      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
12      - MYSQL_DATABASE=${DB_DATABASE}
13      - MYSQL_USER=${DB_USERNAME}
14      - MYSQL_PASSWORD=${DB_PASSWORD}
15    volumes:
16      - ./data:/var/lib/mysql
17      - ./conf:/etc/mysql/conf.d

postgresql

 1version: "3"
 2
 3services:
 4  postgres:
 5    image: postgres:15
 6    ports:
 7      - ${PORT}:5432
 8    volumes:
 9      - ./data:/var/lib/postgresql/data
10    environment:
11      - POSTGRES_USER=${POSTGRES_USER}
12      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
13      - POSTGRES_DB=${POSTGRES_DB}

rsshub

1wget https://raw.githubusercontent.com/DIYgod/RSSHub/master/docker-compose.yml

redis

 1version: "3"
 2
 3services:
 4  redis:
 5    image: redis:alpine
 6    container_name: redis
 7    ports:
 8      - "${REDIS_PORT}:6379"
 9    restart: always
10    command: "redis-server --requirepass ${REDIS_PASSWORD}"
11    # command: "redis-server"
12    volumes:
13      - ./data:/data

faka-shop

 1version: "3"
 2
 3services:
 4  faka:
 5    image: ghcr.io/apocalypsor/dujiaoka:latest
 6    container_name: faka
 7    environment:
 8      - INSTALL=${INSTALL}
 9    volumes:
10      - ./.env:/dujiaoka/.env
11      - ./uploads:/dujiaoka/public/uploads
12      - ./storage:/dujiaoka/storage
13    ports:
14      - ${PORT}:80
15    restart: always
16    depends_on:
17      - db
18      - redis
19  db:
20    image: mariadb:focal
21    container_name: faka-data
22    restart: always
23    environment:
24      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
25      - MYSQL_DATABASE=${DB_DATABASE}
26      - MYSQL_USER=${DB_USERNAME}
27      - MYSQL_PASSWORD=${DB_PASSWORD}
28    volumes:
29      - ./data:/var/lib/mysql
30  redis:
31    image: redis:alpine
32    container_name: faka-redis
33    ports:
34      - "${REDIS_PORT}:6379"
35    restart: always
36    command: "redis-server --requirepass ${REDIS_PASSWORD}"
37    volumes:
38      - ./redis:/data
 1# .env
 2INSTALL=false # first time -> true
 3PORT=80
 4APP_NAME=APP_NAME
 5APP_ENV=local
 6APP_KEY=APP_KEY
 7APP_DEBUG=false
 8APP_URL=APP_URL
 9ADMIN_HTTPS=false
10ADMIN_ROUTE_PREFIX=/admin
11
12DB_CONNECTION=mysql
13DB_HOST=db
14DB_PORT=3306
15DB_ROOT_PASSWORD=DB_ROOT_PASSWORD
16DB_DATABASE=dujiaoka
17DB_USERNAME=dujiaoka
18DB_PASSWORD=DB_PASSWORD
19
20REDIS_HOST=redis
21REDIS_PASSWORD=REDIS_PASSWORD
22REDIS_PORT=6379
23CACHE_DRIVER=redis
24QUEUE_CONNECTION=redis
25
26LOG_CHANNEL=stack
27BROADCAST_DRIVER=log
28SESSION_DRIVER=file
29SESSION_LIFETIME=120
30
31# zh_CN zh_TW en
32DUJIAO_ADMIN_LANGUAGE=zh_CN