Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following examples apply for users who wish to start containers using the docker-compose utility. Consider that examples have to be adjusted to individual environments.

Examples

...

using Docker Compose with

...

PostgreSQL

Examples are contributed by the Japanese JS7 Community. Find the complete instructions from the Start with JS7 JobScheduler docker-compose (MySQL PostgreSQL version) article.

Docker Compose Configuration: docker-compose.yaml

Download (rename to docker-compose.yaml)docker-compose.yaml-mysql

Code Block
collapse
languageyml
titleExample for use of Docker Compose with MySQLPostgreSQLtrue
version: '3'

services:

  db:
    image: mysql:8.0
    command: --default-authentication-plugin=mysql_native_passwordpostgres:14-alpine
    volumes: 
      - db_data: /var/lib/mysqlpostgresql/data
    ports:
      - "33065432:33065432"
    networks:
      - js7
    environment:
      MYSQLPOSTGRES_ROOTINITDB_PASSWORD: js7rootpasswordARGS: "--encoding=UTF-8 --locale=en_US.UTF-8"
      MYSQLPOSTGRES_DATABASEUSER: js7dbjs7user
      MYSQLPOSTGRES_USERPASSWORD: js7userjs7password
      MYSQLPOSTGRES_PASSWORDDB: js7passwordjs7db
    restart: "no"

  js7-joc-primary:
    depends_on:
      - db
    container_name: js7-joc-primary
    image: sosberlin/js7:joc-${JS7VERSION}
    hostname: js7-joc-primary
    ports:
      - "17446:4446"
    networks:
      - js7
    volumes:
      - js7-joc-primary-config:/var/sos-berlin.com/js7/joc/resources/joc
      - js7-joc-primary-logs:/var/sos-berlin.com/js7/joc/logs
    environment:
      RUN_JS_JAVA_OPTIONS: -Xmx256m
      RUN_JS_USER_ID: "${JS7USERID}:${JS7GROUPID}"
    restart: "no"

networks:
  js7:
    external: true

volumes:

  db_data:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/db_data
      o: bind

  js7-joc-primary-config:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/js7-joc-primary-config
      o: bind

  js7-joc-primary-logs:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/js7-joc-primary-logs
      o: bind

Hibernate Configuration: hibernate.cfg.xml

Downloadhibernate.cfg.xml

Code Block
languagexml
titleExample of hibernate.cfg.xml for MySQLPostgreSQL
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<hibernate-configuration>
 <session-factory>
  <property name="hibernate.connection.driver_class">org.mariadb.jdbcpostgresql.Driver</property>
  <property name="hibernate.connection.password">js7password</property>
  <property name="hibernate.connection.url">jdbc:mariadbpostgresql://db:33065432/js7db</property>
  <property name="hibernate.connection.username">js7user</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect<PostgreSQLDialect</property>
  <property name="hibernate.show_sql">false</property>
  <property name="hibernate.connection.autocommit">false</property>
  <property name="hibernate.format_sql">true</property>
  <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property>
  <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property>
  <property name="hibernate.hikari.maximumPoolSize">10</property>
 </session-factory>
</hibernate-configuration>

Docker Compose with PostgreSQL

Examples are contributed by the Japanese JS7 Community. Find the complete instructions from the Start with JS7 JobScheduler docker-compose (PostgreSQL version) article.

Docker Compose Configuration: docker-compose.yaml

Download (rename to docker-compose.yaml): docker-compose.yaml-postgresql

Code Block
languageyml
titleExample for use of Docker Compose with PostgreSQL
collapsetrue
version: '3'

services:

  db:
    image: postgres:14-alpine
    volumes: 
      - db_data: /var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - js7
    environment:
      POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --locale=en_US.UTF-8"
      POSTGRES_USER: js7user
      POSTGRES_PASSWORD: js7password
      POSTGRES_DB: js7db
    restart: "no"

  js7-joc-primary:
    depends_on:
      - db
    container_name: js7-joc-primary
    image: sosberlin/js7:joc-${JS7VERSION}
    hostname: js7-joc-primary
    ports:
      - "17446:4446"
    networks:
      - js7
    volumes:
      - js7-joc-primary-config:/var/sos-berlin.com/js7/joc/resources/joc
      - js7-joc-primary-logs:/var/sos-berlin.com/js7/joc/logs
    environment:
      RUN_JS_JAVA_OPTIONS: -Xmx256m
      RUN_JS_USER_ID: "${JS7USERID}:${JS7GROUPID}"
    restart: "no"

networks:
  js7:
    external: true

volumes:

  db_data:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/db_data
      o: bind

  js7-joc-primary-config:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/js7-joc-primary-config
      o: bind

  js7-joc-primary-logs:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/js7-joc-primary-logs
      o: bind

...