Sign inSign up

dbflute/dbflute-intro

By dbflute

Updated about 4 years ago

DBFlute Intro Official Docker Image !

Image
2

1.1K

dbflute/dbflute-intro repository overview

Quick reference

How to run

Case 1. Run DBFlute Intro with docker command

If you want just to run DBFlute Intro, execute next command and access localhost:8926 with your browser.

$ docker run -p 8926:8926 dbflute/dbflute-intro:latest
Case 2. Run DBFlute Intro with docker command without dbflute client. (For first time users)

If you are new to DBFlute, this section is suitable for you.

  1. Prepare a directory for DBFlute Intro in your project. (Example: dbflute_intro)
  2. Mount it and run Docker.
$ docker run -p 8926:8926 \
-v $(pwd)/dbflute_intro:/app dbflute/dbflute-intro:latest
  1. Access to http://0.0.0.0:8926/#welcome
  2. Create Client When you have finished creating the client, the dbflute-intro directory should look like this.
your-project-dir
|-...
|
|-dbflute_intro
|  |-dbflute_{your_client}
|  |-dbflute-intro.jar
|  |-mydbflute
|
  1. (recommend) add dbflute-intro.jar to .gitignore
// .gitignore
// ... your configurations
dbflute-intro.jar
Case 3. Run DBFlute Intro with docker command (loading dbflute engine and dbflute client from local machine)

If you already have dbflute engine (mydbflute) and dbflute client (dbflute_xxx) in your local machine, this section is suitable for you. This section brings you to start DBFlute Intro and enable it to access the local resources.

For instance, consider a case that you have your own project, your-project-dir, and the directory structure is below.

your-project-dir
|-...
|
|-dbflute_xxx
|  |-dfprop
|  |-log
|  |-...
|
|-dbflute_yyy
|  |-dfprop
|  |-log
|  |-...
|
|-mydbflute
  |-dbflute-1.x.x
  |-dbflute-1.x.y

Change directory to the project root and execute next command.

$ docker run -p 8926:8926 \
-v $(pwd)/dbflute_xxx:/app/dbflute_xxx \
-v $(pwd)/dbflute_yyy:/app/dbflute_yyy \
-v $(pwd)/mydbflute:/app/mydbflute dbflute/dbflute-intro:latest
Case 4. Run DBFlute Intro with docker compose

In many cases, you need to run not only DBFlute Intro but also other middlewares at the same time. Then one of excellent solutions is docker compose. Next is an example of docker-compose.yml, which starts DBFlute Intro and MySQL.

version: '2'
services:

  intro: ######################################################### DBFlute-Intro 
    image: dbflute/dbflute-intro
    ports:
      - "8926:8926"
    volumes:
      - ./dbflute_xxx:/app/dbflute_xxx/:rw
      - ./dbflute_yyy:/app/dbflute_yyy/:rw
      - ./mydbflute:/app/mydbflute/:rw
      - ./src:/app/src/:ro
    environment:
      DBFLUTE_ENVIRONMENT_TYPE: "docker"
    links:
      - db
    networks:
      - fortress-net
      
  db: ############################################################ MySQL
    container_name: fortress-mysql
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: "xxx"
      MYSQL_USER: "root"
    expose:
      - "3306"
    ports:
      - "3306:3306"
    networks:
      - fortress-net

networks:
  fortress-net:
    driver: bridge

To enable dbflute client to access the MySQL database, some settings are necessary. We would like to refer some lines from above yml file.

environment:
  DBFLUTE_ENVIRONMENT_TYPE: "docker"

These lines set DBFlute environment variable. Then, you need to create directory, docker, in dfprop directory and locate some dfprop files.

your-project-dir
|-...
|
|-dbflute_xxx
|  |-dfprop
|  |  |-docker ☆
|  |  |  |-replaceSchemaMap.dfprop ☆
|  |  |  |-databaseInfoMap.dfprop ☆
|  |  |-replaceSchemaMap.dfprop
|  |  |-databaseInfoMap.dfprop
|  |-...
|
|-mydbflute
| |-dbflute-1.x.x
|-docker-compose.yml
replaceSchemaMap.dfprop
map:{
  ; additionalUserMap = map:{
      ; system = map:{
          ; url = jdbc:mysql://fortress-mysql
          ; user = root
          ; password =
      }
  }
}
databaseInfoMap.dfprop
map:{
    ; driver   = com.mysql.jdbc.Driver
    ; url      = jdbc:mysql://fortress-mysql/xxx
    ; schema   =
    ; user     = root
    ; password =
}

Sample project

https://github.com/lastaflute/lastaflute-test-fortress

Next commands start sample web application, MySQL and DBFlute Intro.

$ cd path/to/lastaflute-test-fortress
$ mvn package
$ docker-compose up

Tag summary

Content type

Image

Digest

Size

257 MB

Last updated

about 4 years ago

docker pull dbflute/dbflute-intro