Skip to content

Commit

Permalink
fixes: rebase issues and updates docker env
Browse files Browse the repository at this point in the history
  • Loading branch information
raygervais committed Mar 15, 2021
1 parent 2cc7341 commit 1a83b14
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 208 deletions.
9 changes: 9 additions & 0 deletions config/env.development
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ IMAGE_PORT=4444
# Image Service URL
IMAGE_URL=http://api.telescope.localhost/v1/image

################################################################################
# Search Service
################################################################################

# Search Service Port (default is 4445)
SEARCH_PORT=4445

# Search Service URL
SEARCH_URL=http://api.telescope.localhost/v1/search

################################################################################
# Posts Service
Expand Down
40 changes: 40 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,34 @@ services:
- 'traefik.http.middlewares.strip_auth_prefix.stripprefix.forceSlash=true'
- 'traefik.http.routers.auth.middlewares=strip_auth_prefix'

search:
container_name: 'search'
build:
context: ../src/api/search
dockerfile: Dockerfile
environment:
- ELASTIC_APM_SERVICE_NAME=search
- SEARCH_PORT

- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- ELASTIC_APM_SERVER_URL=http://apm:8200
depends_on:
- elasticsearch
- traefik
ports:
- ${SEARCH_PORT}
labels:
# Enable Traefik
- 'traefik.enable=true'
# Traefik routing for the search service at /v1/search
- 'traefik.http.routers.search.rule=Host(`${API_HOST}`) && PathPrefix(`/${API_VERSION}/search`)'
# Specify the search service port
- 'traefik.http.services.search.loadbalancer.server.port=${SEARCH_PORT}'
# Add middleware to this route to strip the /v1/search prefix
- 'traefik.http.middlewares.strip_search_prefix.stripprefix.prefixes=/${API_VERSION}/search'
- 'traefik.http.middlewares.strip_search_prefix.stripprefix.forceSlash=true'
- 'traefik.http.routers.search.middlewares=strip_search_prefix'

# posts service
posts:
container_name: 'posts'
Expand Down Expand Up @@ -164,3 +192,15 @@ services:
- 'traefik.http.routers.elasticsearch.rule=Host(`elasticsearch.localhost`)'
# Specify the redis port
- 'traefik.http.services.elasticsearch.loadbalancer.server.port=9200'

apm:
image: docker.elastic.co/apm/apm-server:7.10.2
container_name: 'apm'
restart: unless-stopped
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- KIBANA_HOST=http://kibana:5601
ports:
- '8200'
depends_on:
- elasticsearch
207 changes: 0 additions & 207 deletions src/api/docker-compose-api-production.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@elastic/elasticsearch": "^7.11.0",
"@elastic/elasticsearch-mock": "^0.3.0",
"@senecacdot/satellite": "^1.5.2",
"@senecacdot/satellite": "^1.x",
"express-validator": "^6.9.2"
},
"engines": {
Expand Down

0 comments on commit 1a83b14

Please sign in to comment.