diff --git a/docs/dev-ops/docker-compose.yml b/docs/dev-ops/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..bf7706cb019996c226007c82ac28afbb488834c7 --- /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 0000000000000000000000000000000000000000..f6f37818750708730604af730b66e0a569367be7 --- /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