From f6555d4f409d05f508ca1fad5ca0d0ae7fbb7d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5?= <184172133@qq.com> Date: Sun, 28 Jan 2024 16:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5=EF=BC=8Cfeat?= =?UTF-8?q?=EF=BC=9Amaven=20=E5=B7=A5=E7=A8=8B=E8=84=9A=E6=89=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/dev-ops/docker-compose.yml | 97 +++++++++++++++++++++++++++++++++ docs/dev-ops/redis/redis.conf | 2 + 2 files changed, 99 insertions(+) create mode 100644 docs/dev-ops/docker-compose.yml create mode 100644 docs/dev-ops/redis/redis.conf diff --git a/docs/dev-ops/docker-compose.yml b/docs/dev-ops/docker-compose.yml new file mode 100644 index 0000000..bf7706c --- /dev/null +++ b/docs/dev-ops/docker-compose.yml @@ -0,0 +1,97 @@ +# 命令执行 docker-compose -f docker-compose.yml up -d +version: '3.9' +services: + mysql: + image: mysql:8.0.32 + container_name: mysql + hostname: mysql + command: --default-authentication-plugin=mysql_native_password + restart: always + environment: + TZ: Asia/Shanghai + MYSQL_ROOT_PASSWORD: 123456 + MYSQL_USER: xfg + MYSQL_PASSWORD: 123456 + networks: + - my-network + depends_on: + - mysql-job-dbdata + ports: + - "13306:3306" + volumes: + - ./mysql/sql:/docker-entrypoint-initdb.d + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + interval: 5s + timeout: 10s + retries: 10 + start_period: 15s + deploy: + resources: + limits: + cpus: '1.00' + memory: 512M + volumes_from: + - mysql-job-dbdata + + # 自动加载数据 + mysql-job-dbdata: + image: alpine:3.18.2 + container_name: mysql-job-dbdata + volumes: + - /var/lib/mysql + + # phpmyadmin https://hub.docker.com/_/phpmyadmin + phpmyadmin: + image: phpmyadmin:5.2.1 + container_name: phpmyadmin + hostname: phpmyadmin + ports: + - 8899:80 + environment: + - PMA_HOST=mysql + - PMA_PORT=3306 + - MYSQL_ROOT_PASSWORD=123456 + networks: + - my-network + + # RedisAdmin https://github.com/joeferner/redis-commander + redis-admin: + image: spryker/redis-commander:0.8.0 + container_name: redis-admin + hostname: redis-commander + restart: always + ports: + - 8081:8081 + environment: + - REDIS_HOSTS=local:redis:6379 + - HTTP_USER=admin + - HTTP_PASSWORD=admin + networks: + - my-network + depends_on: + redis: + condition: service_healthy + + # Redis + redis: + image: redis:7.2.0 + container_name: redis + restart: always + hostname: redis + ports: + - 6379:6379 + volumes: + - ./redis/redis.conf:/usr/local/etc/redis/redis.conf + command: redis-server /usr/local/etc/redis/redis.conf + networks: + - my-network + healthcheck: + test: [ "CMD", "redis-cli", "ping" ] + interval: 10s + timeout: 5s + retries: 3 + +networks: + my-network: + driver: bridge diff --git a/docs/dev-ops/redis/redis.conf b/docs/dev-ops/redis/redis.conf new file mode 100644 index 0000000..f6f3781 --- /dev/null +++ b/docs/dev-ops/redis/redis.conf @@ -0,0 +1,2 @@ +bind 0.0.0.0 +port 6379 \ No newline at end of file -- GitLab