Database

Usage

cat > docker-compose.yml <<-'EOF'
# https://hub.docker.com/_/mysql
# Port: 3306 5433
version: "3"

services:
  mysql:
    image: mysql:8
    environment:
      - MYSQL_ROOT_PASSWORD=<password>
    network_mode: host
    restart: always
    volumes:
      - $PWD/mysql/:/var/lib/mysql/

  postgres:
    image: postgres:15.3-bookworm
    environment:
      - POSTGRES_PASSWORD=<password>
    network_mode: host
    restart: always
    volumes:
      - $PWD/postgresql/:/var/lib/postgresql/data/

# <password> is the password for the root user
EOF

Start

docker-compose up --detach

Stop

docker-compose down
posted @ 2023-10-08 05:10  Arkx86  阅读(53)  评论(0)    收藏  举报