Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/358416 )

Change subject: K8s: Add the Dockerfile and config for Kubernetes
......................................................................

K8s: Add the Dockerfile and config for Kubernetes

Change-Id: Ic5f845b6fe977f0ab9a218eeeeaba3812a29ba67
---
M .gitignore
A dist/Dockerfile
A dist/config.yaml
3 files changed, 104 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/16/358416/1

diff --git a/.gitignore b/.gitignore
index 850a956..23a1869 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
-Dockerfile
+/Dockerfile
 .idea/
 coverage
-config.yaml
+/config.yaml
 node_modules
 npm-debug.log
diff --git a/dist/Dockerfile b/dist/Dockerfile
new file mode 100644
index 0000000..acdf15c
--- /dev/null
+++ b/dist/Dockerfile
@@ -0,0 +1,9 @@
+FROM wikimedia/nodejs
+RUN mkdir /opt/service
+ADD . /opt/service
+COPY dist/config.yaml /opt/service/
+WORKDIR /opt/service
+ENV HOME=/root LINK=g++
+RUN npm install && npm dedupe
+ENV IN_DOCKER=1
+CMD npm start
diff --git a/dist/config.yaml b/dist/config.yaml
new file mode 100644
index 0000000..1266442
--- /dev/null
+++ b/dist/config.yaml
@@ -0,0 +1,93 @@
+# Number of worker processes to spawn.
+# Set to 0 to run everything in a single process without clustering.
+# Use 'ncpu' to run as many workers as there are CPU units
+num_workers: 0
+
+# Log error messages and gracefully restart a worker if v8 reports that it
+# uses more heap (note: not RSS) than this many mb.
+worker_heap_limit_mb: 250
+
+# Logger info
+logging:
+  level: info
+#  streams:
+#  # Use gelf-stream -> logstash
+#  - type: gelf
+#    host: logstash1003.eqiad.wmnet
+#    port: 12201
+
+# Statsd metrics reporter
+metrics:
+  #type: log
+  #host: localhost
+  #port: 8125
+
+services:
+  - name: citoid
+    # a relative path or the name of an npm package, if different from name
+    module: ./app.js
+    # optionally, a version constraint of the npm package
+    # version: ^0.4.0
+    # per-service config
+    conf:
+      # the port to bind to
+      port: 1970
+      # IP address to bind to, all IPs by default
+      # interface: localhost # uncomment to only listen on localhost
+      # more per-service config settings
+      # the location of the spec, defaults to spec.yaml if not specified
+      # spec: ./spec.template.yaml
+      # allow cross-domain requests to the API (default '*')
+      cors: '*'
+      # to disable use:
+      # cors: false
+      # to restrict to a particular domain, use:
+      # cors: restricted.domain.org
+      # content for the CSP headers
+      # csp: false  # uncomment this line to disable sending them
+      # URL of the outbound proxy to use (complete with protocol)
+      # proxy: http://my.proxy.org:8080
+      # the list of domains for which not to use the proxy defined above
+      # no_proxy_list:
+      #   - domain1.com
+      #   - domain2.org
+      # the list of incoming request headers that can be logged; if left empty,
+      # the following headers are allowed: cache-control, content-length,
+      # content-type, if-match, user-agent, x-request-id
+      # log_header_whitelist:
+      #   - cache-control
+      #   - content-length
+      #   - content-type
+      #   - if-match
+      #   - user-agent
+      #   - x-request-id
+      # User-Agent HTTP header to use for requests
+      userAgent: Citoid
+      # enable use of zotero's translation-server service to query for URLs; 
defaults to true if undefined
+      zotero: true
+      # URL where to contact Zotero
+      zoteroInterface: 127.0.0.1
+      # zotero's server port
+      zoteroPort: 1969
+      # whether the proxy should be used to contact zotero
+      zoteroUseProxy: false
+      # enable use of worldcat xisbn service to query for isbns; free for 
non-commercial use when usage does not exceed 1000 requests per day.
+      xisbn: false
+      # enable use of worldcat Search API; requires wskey & subscription to 
access
+      wskey: 
SzH9M2MhDgFmp0nyi8xKGI62A2Ll3cB4j8krnON0ZJPQqzqm0uo1Du3CNYk7mVllOcujIsWWwLumboHj
+      allowPrivateAddresses: true
+      maxRedirects: 10
+      # the template used for contacting the MW API
+      mwapi_req:
+        method: post
+        uri: https://{{domain}}/w/api.php
+        headers:
+          user-agent: '{{user-agent}}'
+        body: '{{ default(request.query, {}) }}'
+      # the template used for contacting RESTBase
+      restbase_req:
+        method: '{{request.method}}'
+        uri: https://{{domain}}/api/rest_v1/{+path}
+        query: '{{ default(request.query, {}) }}'
+        headers: '{{request.headers}}'
+        body: '{{request.body}}'

-- 
To view, visit https://gerrit.wikimedia.org/r/358416
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5f845b6fe977f0ab9a218eeeeaba3812a29ba67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <mobro...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to