Browse Source

Fix docker issues (#873)

pull/1/head
rozetko 5 years ago committed by GitHub
parent
commit
d0f241bb15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .dockerignore
  2. 14
      docker-compose-mongo.yml
  3. 13
      docker-compose.yml
  4. 5
      server/Dockerfile

4
.dockerignore

@ -1,4 +1,4 @@
*
!.git/HEAD
!.git/refs
# TODO: we don't need all files from .git
!.git
!server

14
docker-compose-mongo.yml

@ -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}
@ -24,6 +22,8 @@ services:
ports:
- ${HASTIC_PORT:-8000}:8000
networks:
- hastic-network
restart: always
depends_on:
- mongo
@ -31,6 +31,11 @@ services:
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:
@ -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
@ -48,3 +55,6 @@ services:
volumes:
hastic_mongo:
hastic_mongo_config:
networks:
hastic-network:

13
docker-compose.yml

@ -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}
@ -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
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

Loading…
Cancel
Save