Docker Compose: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==docker-compose.yml==
<source lang="properties">
<source lang="properties">
version: "3.9"
version: "3.9"
Line 6: Line 7:
     container_name: crawler
     container_name: crawler
     labels:
     labels:
       org.chorke.academia.http.spider: "Finoloyg Web Crawler"
       org.chorke.academia.http.spider: "Academia Web Crawler"
     depends_on:
     depends_on:
       - db
       - db
Line 44: Line 45:
       config:
       config:
         - subnet: 10.20.21.0/24
         - subnet: 10.20.21.0/24
</source>
==application-docker.yml==
<source lang="properties">
################################################################################
# application snake yaml properties
################################################################################
academia:
  env:
    user:
      home: ${user.home}
      mode: dev
      name: ${user.name}
      temp: ${java.io.tmpdir}
  datasource:
    url: ${CHORKE_DS_JDBC_URL}
    database: ${CHORKE_DS_DATABASE}
    username: ${CHORKE_DS_USERNAME}
    password: ${CHORKE_DS_PASSWORD}
    poolname: ${CHORKE_DS_POOLNAME}
server:
  tomcat:
    basedir: ./target/
spring:
  thymeleaf:
    mode: HTML
    prefix: classpath:/META-INF/thymeleaf/
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: ${academia.datasource.url}
    username: ${academia.datasource.username}
    password: ${academia.datasource.password}
    driver-class-name: ${CHORKE_DS_DBDRIVER}
    hikari:
      pool-name: ${academia.datasource.poolname}
      connection-test-query: ${CHORKE_DS_SQLQUERY}
      auto-commit: false
logging:
  level:
    org.springframework: WARN
    org.chorke: INFO
---
spring:
  profiles: dev
logging:
  level:
    org.springframework: WARN
    org.chorke: INFO
---
spring:
  profiles: uat
logging:
  level:
    org.springframework: WARN
    org.chorke: WARN
---
spring:
  profiles: pro
logging:
  level:
    org.springframework: WARN
    org.chorke: WARN
################################################################################
# built on: Sat, Oct 10 2020, 10:10 +0000                    by: [email protected]
################################################################################
</source>
==application-docker.properties==
<source lang="properties">
################################################################################
# application properties
################################################################################
spring.jackson.date-format: yyyy-MM-dd'T'HH:mm:ss
spring.servlet.multipart.max-request-size: 10MB
spring.servlet.multipart.max-file-size: 1MB
spring.main.banner-mode: off
spring.profiles.active: dev
server.ssl.key-store: ${user.home}/.chorke/academia/etc/keystore/http/dev/spider.jks
server.ssl.key-store-password: storepasswd
server.ssl.key-password: storepasswd
server.ssl.keyAlias: academia
server.ssl.enabled: false
academia.http.spider.seleniumDriverBasePath: ${user.home}/.chorke/academia/var/selenium/driver
academia.http.spider.seleniumDriverTempPath: ${user.home}/.chorke/academia/tmp/selenium/driver
academia.http.spider.crawlUserAgentString: Finology Crawler (https://academia.com.my/)
academia.http.spider.crawlStorageFolder: ${user.home}/.chorke/academia/tmp/http/spider
academia.http.spider.maxDepthOfCrawling: 2
academia.http.spider.resumableCrawling: false
academia.http.spider.numberOfCrawlers: 7
academia.http.spider.politenessDelay: 200
academia.http.spider.maxPagesToFetch: -1
academia.http.spider.enabledRobots: false
academia.http.spider.enabledChrome: false
spring.jpa.properties.hibernate.dialect: ${CHORKE_JPA_DIALECT}
spring.jpa.properties.hibernate.format_sql: true
spring.jpa.hibernate.ddl-auto: none
spring.jpa.open-in-view: false
spring.jpa.show-sql: ${CHORKE_JPA_SHOWSQL}
spring.cache.ehcache.config: classpath:/META-INF/ehcache/ehcache.xml
spring.cache.cache-names: academia_cache
spring.cache.type: ehcache
spring.h2.console.settings.web-allow-others: ${CHORKE_H2_ALLOWALL}
spring.h2.console.settings.trace: false
spring.h2.console.path: /h2admin
spring.h2.console.enabled: ${CHORKE_H2_WEBADMIN}
graphql.servlet.mapping: /graphql
graphql.servlet.enabled: ${CHORKE_GQL_ENABLED}
graphiql.mapping: /graphiql
graphiql.endpoint: /graphql
graphiql.enabled: ${CHORKE_GQL_BROWSER}
spring.liquibase.enabled: true
spring.liquibase.contexts: ${CHORKE_LIQ_CONTEXT}
spring.liquibase.change-log: classpath:/META-INF/migrations/db.changelog-master.xml
################################################################################
# built on: Sat, Oct 10 2020, 10:10 +0000                    by: [email protected]
################################################################################
</source>
</source>



Revision as of 10:35, 31 January 2021

docker-compose.yml

version: "3.9"
services:
  web:
    build: .
    container_name: crawler
    labels:
      org.chorke.academia.http.spider: "Academia Web Crawler"
    depends_on:
      - db
      - redis
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - CHORKE_DS_POOLNAME=java:jboss/datasources/PG_http_spider_devDS
      - CHORKE_DS_JDBC_URL=jdbc:postgresql://db:5432/academia
      - CHORKE_DS_DBDRIVER=org.postgresql.Driver
      - CHORKE_DS_DATABASE=academia
      - CHORKE_DS_USERNAME=academia
      - CHORKE_DS_PASSWORD=academia
      - CHORKE_DS_SQLQUERY=SELECT 1
      - CHORKE_H2_WEBADMIN=false
      - CHORKE_H2_ALLOWALL=false
      - CHORKE_GQL_BROWSER=true
      - CHORKE_GQL_ENABLED=true
      - CHORKE_JPA_DIALECT=org.hibernate.dialect.PostgreSQLDialect
      - CHORKE_JPA_SHOWSQL=true
      - CHORKE_LIQ_CONTEXT=dev
  redis:
    container_name: redis
    image: redis
      networks:
        default:
          aliases:
            - redis.academia.chorke.org
  db:
    image: 'postgres:13.1-alpine'
      networks:
        default:
          aliases:
            - db.academia.chorke.org
networks:
  default:
    ipam:
      config:
        - subnet: 10.20.21.0/24

application-docker.yml

################################################################################
# application snake yaml properties
################################################################################
academia:
  env:
    user:
      home: ${user.home}
      mode: dev
      name: ${user.name}
      temp: ${java.io.tmpdir}
  datasource:
    url: ${CHORKE_DS_JDBC_URL}
    database: ${CHORKE_DS_DATABASE}
    username: ${CHORKE_DS_USERNAME}
    password: ${CHORKE_DS_PASSWORD}
    poolname: ${CHORKE_DS_POOLNAME}
server:
  tomcat:
    basedir: ./target/
spring:
  thymeleaf:
    mode: HTML
    prefix: classpath:/META-INF/thymeleaf/
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: ${academia.datasource.url}
    username: ${academia.datasource.username}
    password: ${academia.datasource.password}
    driver-class-name: ${CHORKE_DS_DBDRIVER}
    hikari:
      pool-name: ${academia.datasource.poolname}
      connection-test-query: ${CHORKE_DS_SQLQUERY}
      auto-commit: false
logging:
  level:
    org.springframework: WARN
    org.chorke: INFO
---
spring:
  profiles: dev
logging:
  level:
    org.springframework: WARN
    org.chorke: INFO
---
spring:
  profiles: uat
logging:
  level:
    org.springframework: WARN
    org.chorke: WARN
---
spring:
  profiles: pro
logging:
  level:
    org.springframework: WARN
    org.chorke: WARN
################################################################################
# built on: Sat, Oct 10 2020, 10:10 +0000                    by: [email protected]
################################################################################

application-docker.properties

################################################################################
# application properties
################################################################################
spring.jackson.date-format: yyyy-MM-dd'T'HH:mm:ss
spring.servlet.multipart.max-request-size: 10MB
spring.servlet.multipart.max-file-size: 1MB
spring.main.banner-mode: off
spring.profiles.active: dev

server.ssl.key-store: ${user.home}/.chorke/academia/etc/keystore/http/dev/spider.jks
server.ssl.key-store-password: storepasswd
server.ssl.key-password: storepasswd
server.ssl.keyAlias: academia
server.ssl.enabled: false

academia.http.spider.seleniumDriverBasePath: ${user.home}/.chorke/academia/var/selenium/driver
academia.http.spider.seleniumDriverTempPath: ${user.home}/.chorke/academia/tmp/selenium/driver
academia.http.spider.crawlUserAgentString: Finology Crawler (https://academia.com.my/)
academia.http.spider.crawlStorageFolder: ${user.home}/.chorke/academia/tmp/http/spider
academia.http.spider.maxDepthOfCrawling: 2
academia.http.spider.resumableCrawling: false
academia.http.spider.numberOfCrawlers: 7
academia.http.spider.politenessDelay: 200
academia.http.spider.maxPagesToFetch: -1
academia.http.spider.enabledRobots: false
academia.http.spider.enabledChrome: false

spring.jpa.properties.hibernate.dialect: ${CHORKE_JPA_DIALECT}
spring.jpa.properties.hibernate.format_sql: true
spring.jpa.hibernate.ddl-auto: none
spring.jpa.open-in-view: false
spring.jpa.show-sql: ${CHORKE_JPA_SHOWSQL}

spring.cache.ehcache.config: classpath:/META-INF/ehcache/ehcache.xml
spring.cache.cache-names: academia_cache
spring.cache.type: ehcache

spring.h2.console.settings.web-allow-others: ${CHORKE_H2_ALLOWALL}
spring.h2.console.settings.trace: false
spring.h2.console.path: /h2admin
spring.h2.console.enabled: ${CHORKE_H2_WEBADMIN}

graphql.servlet.mapping: /graphql
graphql.servlet.enabled: ${CHORKE_GQL_ENABLED}

graphiql.mapping: /graphiql
graphiql.endpoint: /graphql
graphiql.enabled: ${CHORKE_GQL_BROWSER}

spring.liquibase.enabled: true
spring.liquibase.contexts: ${CHORKE_LIQ_CONTEXT}
spring.liquibase.change-log: classpath:/META-INF/migrations/db.changelog-master.xml
################################################################################
# built on: Sat, Oct 10 2020, 10:10 +0000                    by: [email protected]
################################################################################

References