docker-compose DB系

Oracle

https://github.com/oracle/docker-images

1
2
3
git clone https://github.com/oracle/docker-images.git
cd docker-images/OracleDatabase/SingleInstance/dockerfiles
./buildDockerImage.sh -v 18.4.0 -x
1
2
3
4
5
6
7
8
9
10
11
12
13
version: '3.8'
services:

db:
image: oracle/database:18.4.0-xe
ports:
- 1521:1521
- 5500:5500
environment:
- ORACLE_PWD=xxxxxxxxxxxx
volumes:
- ./db-data:/opt/oracle/oradata
- ./db-script:/opt/oracle/scripts/setup

MariaDB

https://hub.docker.com/_/mariadb

1
2
3
4
5
6
7
8
9
10
11
12
13
version: '3'
services:

mariadb:
container_name: mariadb
image: mariadb:10.5
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=xxxxxxxxxxxx
volumes:
- ./db-data:/var/lib/mysql
- ./db-script:/docker-entrypoint-initdb.d

Microsoft SQL Server

https://hub.docker.com/_/microsoft-mssql-server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
version: '3'
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
container_name: mssql
ports:
- "1433:1433"
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=xxxxxxxxxxxx
- MSSQL_PID=Developer
- MSSQL_LCID=1041
- MSSQL_COLLATION=Japanese_CI_AS


PostgreSQL

https://hub.docker.com/_/postgres

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
version: '3'

services:

postgres:
build:
context: .
dockerfile: ./dockerfiles/postgresql/Dockerfile
args:
- DB_LANG=ja_JP
image: postgres:13
container_name: "postgres"
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: xxxxxxxxxxxx
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --locale=C"
volumes:
- ./db-data:/var/lib/postgresql/data
- ./db-script:/docker-entrypoint-initdb.d

pgadmin4:
image: dpage/pgadmin4:latest
container_name: pgadmin4
ports:
- "8000:80"
environment:
PGADMIN_DEFAULT_EMAIL: xxxxxxxxxxxx@xxxxxxxxxxxx
PGADMIN_DEFAULT_PASSWORD: xxxxxxxxxxxx
hostname: pgadmin4
depends_on:
- postgres

Redis

https://hub.docker.com/_/redis

1
2
3
4
5
6
7
8
version: '3'
services:
redis:
image: "redis:latest"
ports:
- "6379:6379"
volumes:
- "./data/redis:/data"