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
dist
config/config.json
config.json
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
VOLUME [ "/var/www/data" ]
COPY . /var/www/analytics/
WORKDIR /var/www/analytics
COPY ./requirements.txt /var/www/analytics
RUN pip install -r requirements.txt \
&& apt-get update && apt-get install -y \
apt-utils \
@ -15,4 +13,8 @@ RUN pip install -r requirements.txt \
g++ \
git
VOLUME [ "/var/www/data" ]
COPY . /var/www/analytics/
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))
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
build: server
environment:
HASTIC_API_KEY: "eyJrIjoiNzhiYjIyTGZDMjY4M3lnYTNwWHo3WFVaNnVDSm9qakkiLCJuIjoiaGFzIiwiaWQiOjF9"
ZMQ_CONNECTION_STRING: tcp://analytics:8002
ports:
- 8000:8000
HASTIC_API_KEY: ${HASTIC_API_KEY}
ZMQ_CONNECTION_STRING: tcp://0.0.0.0:8002
network_mode: host
volumes:
- data-volume:/var/www/data
privileged: true
analytics:
image: hastic-analytics
build: analytics
ports:
- 8002:8002
volumes:
data-volume:

17
server/Dockerfile

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

2
server/src/services/analytics_service.ts

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

Loading…
Cancel
Save