Skip to content

Commit

Permalink
Fix docker issues (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozetko committed Mar 5, 2020
1 parent 45dc3f2 commit d0f241b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
@@ -1,4 +1,4 @@
*
!.git/HEAD
!.git/refs
# TODO: we don't need all files from .git
!.git
!server
14 changes: 12 additions & 2 deletions docker-compose-mongo.yml
Expand Up @@ -6,12 +6,10 @@ services:
dockerfile: server/Dockerfile
context: .
environment:

HASTIC_API_KEY: ${HASTIC_API_KEY?"HASTIC_API_KEY variable is required"}
GRAFANA_URL: ${GRAFANA_URL?"GRAFANA_URL variable is required"}

HASTIC_DB_CONNECTION_STRING: ${HASTIC_MONGO_USER:-hastic}:${HASTIC_MONGO_PASSWORD:-password}@mongo:27017/${HASTIC_MONGO_DB:-hastic}
ZMQ_CONNECTION_STRING: ${ZMQ_CONNECTION_STRING:-tcp://analytics:8002}

HASTIC_ALERT_TYPE: ${HASTIC_ALERT_TYPE}
HASTIC_ALERTMANAGER_URL: ${HASTIC_ALERTMANAGER_URL}
Expand All @@ -24,13 +22,20 @@ services:

ports:
- ${HASTIC_PORT:-8000}:8000
networks:
- hastic-network
restart: always
depends_on:
- mongo

analytics:
image: hastic/analytics:latest
build: analytics
environment:
# TODO: use any port for server connection
HASTIC_SERVER_URL: "ws://server:8002"
networks:
- hastic-network
restart: always

mongo:
Expand All @@ -39,6 +44,8 @@ services:
MONGO_INITDB_ROOT_USERNAME: ${HASTIC_MONGO_ADMIN_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${HASTIC_MONGO_ADMIN_PASSWORD:-password}
MONGO_INITDB_DATABASE: ${HASTIC_MONGO_DB:-hastic}
networks:
- hastic-network
restart: always
volumes:
- hastic_mongo:/data/db
Expand All @@ -48,3 +55,6 @@ services:
volumes:
hastic_mongo:
hastic_mongo_config:

networks:
hastic-network:
13 changes: 10 additions & 3 deletions docker-compose.yml
Expand Up @@ -6,12 +6,9 @@ services:
dockerfile: server/Dockerfile
context: .
environment:

HASTIC_API_KEY: ${HASTIC_API_KEY?"HASTIC_API_KEY variable is required"}
GRAFANA_URL: ${GRAFANA_URL?"GRAFANA_URL variable is required"}

ZMQ_CONNECTION_STRING: ${ZMQ_CONNECTION_STRING:-tcp://analytics:8002}

HASTIC_ALERT_TYPE: ${HASTIC_ALERT_TYPE}
HASTIC_ALERTMANAGER_URL: ${HASTIC_ALERTMANAGER_URL}
HASTIC_WEBHOOK_URL: ${HASTIC_WEBHOOK_URL}
Expand All @@ -25,12 +22,22 @@ services:
- ${HASTIC_PORT:-8000}:8000
volumes:
- data-volume:/var/www/data
networks:
- hastic-network
restart: always

analytics:
image: hastic/analytics:latest
build: analytics
environment:
# TODO: use any port for server connection
HASTIC_SERVER_URL: "ws://server:8002"
networks:
- hastic-network
restart: always

volumes:
data-volume:

networks:
hastic-network:
5 changes: 2 additions & 3 deletions server/Dockerfile
@@ -1,10 +1,9 @@
FROM node:8-alpine AS build

# tools for building zeromq

RUN apk add --no-cache curl gnupg make g++ bash python
RUN apk add --no-cache git

# Note: context starts in the directory above (see docker-compose file)
COPY .git /var/www/.git
COPY server /var/www/server

WORKDIR /var/www/server
Expand Down

0 comments on commit d0f241b

Please sign in to comment.