Skip to content

Commit

Permalink
Improve Docker setup (#6)
Browse files Browse the repository at this point in the history
* moved docker files into dedicated folder docker/
* renamed patzilla.ini.tpl to docker.patzilla.ini to make clear that the file is docker related
* added patzilla.ini template again, because it is needed for connecting to mongodb container
* corrected small logical error in docker-compose.yml
* commented out link to local patzilla.ini
* removed docker.patzilla.ini; instead production.ini.tpl is copied into the image as default and local patzilla.ini is linked into container, if present
* updated docker files, added patzilla.ini to be used within docker container
  • Loading branch information
aghster authored and amotl committed Nov 30, 2018
1 parent 979f105 commit d7aeec5
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ RUN apk add --no-cache --update \
python2 \
python2-dev \
build-base \
jpeg-dev \
freetype-dev \
lcms2-dev \
tiff-dev \
libffi-dev \
openssl-dev \
libxml2-dev \
Expand All @@ -16,6 +20,6 @@ RUN apk add --no-cache --update \
pip install --upgrade pip setuptools && \
rm -r /root/.cache && \
pip install patzilla
COPY patzilla.ini /patzilla.ini
CMD ["/usr/bin/pserve", "/patzilla.ini"]
EXPOSE 9999 6543
ENTRYPOINT ["/usr/bin/pserve"]
CMD ["/patzilla.ini"]
EXPOSE 9999 6543
6 changes: 5 additions & 1 deletion docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@ version: "3"
services:
patzilla:
build: .
image: alpine-patzilla
image: aghster/patzilla
ports:
- 9999:9999
- 6543:6543
volumes:
- ./patzilla.ini:/patzilla.ini:ro
networks:
- patzilla_net
container_name: patzilla
depends_on:
- mongodb
restart: unless-stopped
mongodb:
image: mvertes/alpine-mongo
ports:
- 27017:27017
networks:
- patzilla_net
container_name: mongodb
restart: unless-stopped

networks:
patzilla_net:
270 changes: 270 additions & 0 deletions docker/patzilla.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
# =================================
# General application configuration
# =================================

[main]
include = vendors.ini


[ip_navigator]

# Which vendors are enabled?
# The selection process will use the first configured vendor as default, after that it
# will search through the other configured vendors and will select the one which matches
# the "hostname_matches" pattern on a first come, first serve basis.
vendors = patzilla

# Which datasources are configured?
# Choose one or more of ops, depatisnet, depatisconnect, ificlaims, depatech, sip.
datasources = ops, depatisnet

# Fields to protect from being leaked into Javascript environment
datasources_protected_fields = api_consumer_key, api_consumer_secret, api_uri, api_username, api_password

# Whether to run the instance in development mode
development_mode = false


# ====================
# Vendor configuration
# ====================

[vendor:patzilla]
organization = PatZilla
productname = PatZilla IP Navigator
productname_html = <span class="header-logo">PatZilla <i class="circle-icon">IP</i> Navigator</span>
page_title = Patent search
copyright_html = &copy; 2013-2018, <a href="https://www.example.org/" class="incognito pointer" target="_blank">Example Inc.</a> — All rights reserved.
stylesheet_uri = /static/vendor/patzilla/patzilla.css


# ========================
# Datasource configuration
# ========================

[datasource:ops]

# Application-wide authentication credentials
api_consumer_key = {ops_api_consumer_key}
api_consumer_secret = {ops_api_consumer_secret}

# 3.1.2. Fulltext inquiry and retrieval including description or claims
# Note, Currently full texts (description and/or claims) are only available for the following
# authorities: EP, WO, AT, BE, CA, CH, CY, ES, FR, GB, HR, IE, LU, MC, MD, NO, PL, PT, RO.
# -- https://forums.epo.org/ops-extends-data-coverage-for-character-coded-full-text-xml-to-19-country-collections-7833
fulltext_enabled = true
fulltext_countries = EP, WO, AT, BE, CA, CH, CY, ES, FR, GB, HR, IE, LU, MC, MD, NO, PL, PT, RO


[datasource:depatisconnect]

# Local development
#api_uri = http://localhost:20300

# Production
api_uri = {depatisconnect_api_uri}

# 2014-07-02: Add fulltexts for DE and US through DEPATISconnect
fulltext_enabled = true
fulltext_countries = DE, US


[datasource:ificlaims]

# API connection settings
api_uri = {ificlaims_api_uri}
api_username = {ificlaims_api_username}
api_password = {ificlaims_api_password}

# 2017-03-09: Add fulltexts for more countries through IFI CLAIMS
fulltext_enabled = true
fulltext_countries = BE, CA, CN, FR, GB, IN, JP, KR, LU, NL, RU
# Not enabled yet: EA, SI, ES, IN, AU, HK, BR, PL, CZ, IT, NZ, HU, TR, DK, HR, YU, RS, PT, UA, ZA, SE, MX, NO, BG, SK, TW, AR, GR, ID, IL, FI, DD, CS, MC

details_enabled = true
details_countries = CN, IN, KR


[datasource:depatech]

# API connection settings
api_uri = {depatech_api_uri}
api_username = {depatech_api_username}
api_password = {depatech_api_password}



# ========================
# Email/SMTP configuration
# ========================

[smtp]
# smtp host information
hostname = {smtp_hostname}
port = 587 ; smtp submission port, default: 25
tls = true ; use TLS, default: true
username = {smtp_username}
password = {smtp_password}

[email_addressbook]

# Sender addresses "From" and "Reply-To"
from = IP Navigator <[email protected]>
reply = IP Navigator Support <[email protected]>

# Recipient addresses "To:"
support = IP Navigator Support <[email protected]>
system = IP Navigator System <[email protected]>
purchase = IP Navigator Sales <[email protected]>


[email_content]

# Email content defaults
subject_prefix = [ip-navigator]
body =
Sehr geehrter Kunde,
\n
vielen Dank für Ihre Nachricht!
\n
Diese E-Mail wurde aufgrund Ihrer Mitteilung automatisch von unserem Trackingsystem generiert,
wir werden Ihre Anfrage so schnell wie möglich beantworten.
\n
Bitte kommen Sie sonst telefonisch auf uns zu, unsere Telefonnummer finden Sie in der E-Mail Signatur.
\n
Mit freundlichen Grüßen,
Ihr IP Navigator Support Team.
\n
----
\n
Message:
{{ message }}
\n

{% if details: %}
Details: {{ details }}
\n
{% endif %}

{% if filenames: %}
Im Anhang finden Sie weitere technische Details zu Ihrer Anfrage aus dem Systemkontext:
{{ filenames }}
\n
{% endif %}

signature =
ACME Inc.
Way 42
12345 Universe

Email: [email protected]
Web: https://example.org



###
# Pyramid application configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###

[filter:prefix-middleware]
use = egg:PasteDeploy#prefix

[app:main]
use = egg:PatZilla
filter-with = prefix-middleware


pyramid.reload_templates = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =


# Database configuration
mongodb.patzilla.uri = mongodb://mongodb:27017/patzilla


# Cache settings
cache.url = mongodb://mongodb:27017/beaker.cache
cache.regions = search, medium, longer, static
cache.key_length = 512

cache.search.type = ext:mongodb
cache.search.sparse_collection = true

cache.medium.type = mongodb_gridfs
cache.medium.sparse_collection = true
cache.longer.type = mongodb_gridfs
cache.longer.sparse_collection = true
cache.static.type = mongodb_gridfs
cache.static.sparse_collection = true

# 1 hour
#cache.search.expire = 3600
# 2 hours
cache.search.expire = 7200
# 6 hours
#cache.search.expire = 21600

# medium: 1 day
cache.medium.expire = 86400

# longer: 1 week
cache.longer.expire = 604800

# static: 1 month
cache.static.expire = 2592000



###
# wsgi server configuration
###

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 9999

###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
keys = root, sqlalchemy, patzilla

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_patzilla]
level = INFO
handlers =
qualname = patzilla

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-8.8s [%(name)-40s][%(threadName)s] %(message)s

0 comments on commit d7aeec5

Please sign in to comment.