Browse Source

remove debug logging

pull/1/head
amper43 6 years ago
parent
commit
8fa210d23f
  1. 2
      .gitignore
  2. 12
      Makefile
  3. 10
      analytics/Dockerfile
  4. 2
      analytics/config.py
  5. 10
      docker-compose.yml
  6. 17
      server/Dockerfile
  7. 2
      server/src/services/analytics_service.ts

2
.gitignore vendored

@ -1,6 +1,6 @@
data data
dist dist
config/config.json config.json
node_modules/ node_modules/

12
Makefile

@ -1,12 +0,0 @@
.PHONY: server analytics compose
all: server analytics
server:
docker build server -t hastic-server
analytics:
docker build analytics -t hastic-analytics
compose:
docker-compose up

10
analytics/Dockerfile

@ -1,11 +1,9 @@
FROM python:3.6.6 FROM python:3.6.6
VOLUME [ "/var/www/data" ]
COPY . /var/www/analytics/
WORKDIR /var/www/analytics WORKDIR /var/www/analytics
COPY ./requirements.txt /var/www/analytics
RUN pip install -r requirements.txt \ RUN pip install -r requirements.txt \
&& apt-get update && apt-get install -y \ && apt-get update && apt-get install -y \
apt-utils \ apt-utils \
@ -15,4 +13,8 @@ RUN pip install -r requirements.txt \
g++ \ g++ \
git git
VOLUME [ "/var/www/data" ]
COPY . /var/www/analytics/
CMD ["python", "server.py"] CMD ["python", "server.py"]

2
analytics/config.py

@ -27,4 +27,4 @@ def get_config_field(field, default_val = None):
raise Exception('Please configure {}'.format(field)) raise Exception('Please configure {}'.format(field))
ZMQ_DEV_PORT = get_config_field('ZMQ_DEV_PORT', '8002') ZMQ_DEV_PORT = get_config_field('ZMQ_DEV_PORT', '8002')
ZMQ_CONNECTION_STRING = get_config_field('ZMQ_CONNECTION_STRING', 'tcp://*:%s' % ZMQ_DEV_PORT) ZMQ_CONNECTION_STRING = get_config_field('ZMQ_CONNECTION_STRING', 'tcp://0.0.0.0:%s' % ZMQ_DEV_PORT)

10
docker-compose.yml

@ -4,17 +4,17 @@ services:
image: hastic-server image: hastic-server
build: server build: server
environment: environment:
HASTIC_API_KEY: "eyJrIjoiNzhiYjIyTGZDMjY4M3lnYTNwWHo3WFVaNnVDSm9qakkiLCJuIjoiaGFzIiwiaWQiOjF9" HASTIC_API_KEY: ${HASTIC_API_KEY}
ZMQ_CONNECTION_STRING: tcp://analytics:8002 ZMQ_CONNECTION_STRING: tcp://0.0.0.0:8002
ports: network_mode: host
- 8000:8000
volumes: volumes:
- data-volume:/var/www/data - data-volume:/var/www/data
privileged: true
analytics: analytics:
image: hastic-analytics image: hastic-analytics
build: analytics build: analytics
ports:
- 8002:8002
volumes: volumes:
data-volume: data-volume:

17
server/Dockerfile

@ -1,11 +1,5 @@
FROM python:3.6.6 FROM python:3.6.6
VOLUME [ "/var/www/data" ]
COPY . /var/www/
WORKDIR /var/www/server
RUN apt-get install curl \ RUN apt-get install curl \
bash \ bash \
gnupg \ gnupg \
@ -13,8 +7,15 @@ RUN apt-get install curl \
g++ \ g++ \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \ && curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get update \ && apt-get update \
&& apt-get install nodejs \ && apt-get install nodejs
&& npm install \
VOLUME [ "/var/www/data" ]
COPY . /var/www/server
WORKDIR /var/www/server
RUN npm install \
&& npm run build && npm run build
ENV INSIDE_DOCKER true ENV INSIDE_DOCKER true

2
server/src/services/analytics_service.ts

@ -76,7 +76,7 @@ export class AnalyticsService {
if(this._inDocker) { if(this._inDocker) {
this._zmqConnectionString = config.ZMQ_CONNECTION_STRING; this._zmqConnectionString = config.ZMQ_CONNECTION_STRING;
} else if(this._productionMode) { } else if(this._productionMode && !this._inDocker) {
this._zmqConnectionString = config.ZMQ_CONNECTION_STRING; this._zmqConnectionString = config.ZMQ_CONNECTION_STRING;
if(this._zmqConnectionString === null) { if(this._zmqConnectionString === null) {
var createResult = await AnalyticsService.createIPCAddress(); var createResult = await AnalyticsService.createIPCAddress();

Loading…
Cancel
Save