Unable to access API after deploying gorse with docker-compose #759
-
Description: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I am using the default config.toml and docker-compose.yml, only changing ports to avoid conflict. The following is the screenshot of |
Beta Was this translation helpful? Give feedback.
-
Could you paste your config file and docker compose file here? |
Beta Was this translation helpful? Give feedback.
-
Sure. The main change is the port of data-store, cache-store and server. version: "3"
services:
redis:
image: redis
restart: unless-stopped
ports:
- 16379:6379
mysql:
image: mysql/mysql-server
restart: unless-stopped
ports:
- 13306:3306
environment:
MYSQL_ROOT_PASSWORD: root_pass
MYSQL_DATABASE: gorse
MYSQL_USER: gorse
MYSQL_PASSWORD: gorse_pass
gorse:
image: zhenghaoz/gorse-in-one
restart: unless-stopped
ports:
- 18086:8086 # gRPC port
- 18088:8088 # HTTP port
environment:
# Use Redis as cache storage backend.
GORSE_CACHE_STORE: redis://redis:6379
# Use MySQL as data storage backend.
GORSE_DATA_STORE: mysql://gorse:gorse_pass@tcp(mysql:3306)/gorse?parseTime=true
command: >
-c /etc/gorse/config.toml
--log-path /var/log/gorse/master.log
--cache-path /var/lib/gorse/master_cache.data
volumes:
# Mount the configuration file.
- ./config.toml:/etc/gorse/config.toml
depends_on:
- redis
- mysql
[database]
cache_store = "redis://localhost:16379/0"
data_store = "mysql://gorse:gorse_pass@tcp(localhost:13306)/gorse"
table_prefix = "whereiscat"
cache_table_prefix = "whereiscat"
data_table_prefix = "whereiscat"
[master]
port = 18086
host = "0.0.0.0"
http_port = 18088
http_host = "0.0.0.0"
http_cors_domains = []
http_cors_methods = []
n_jobs = 1
meta_timeout = "10s"
dashboard_user_name = "admin"
dashboard_password = "123456!"
admin_api_key = ""
[server]
default_n = 5
api_key = ""
clock_error = "5s"
auto_insert_user = true
auto_insert_item = true
cache_expire = "10s"
[recommend]
cache_size = 100
cache_expire = "72h"
[recommend.data_source]
positive_feedback_types = ["like"]
read_feedback_types = ["read"]
positive_feedback_ttl = 0
item_ttl = 0
[recommend.popular]
popular_window = "4320h"
[recommend.user_neighbors]
neighbor_type = "auto"
enable_index = true
index_recall = 0.8
index_fit_epoch = 3
[recommend.item_neighbors]
neighbor_type = "auto"
enable_index = true
index_recall = 0.8
index_fit_epoch = 3
[recommend.collaborative]
enable_index = true
index_recall = 0.9
index_fit_epoch = 3
model_fit_period = "60m"
model_search_period = "360m"
model_search_epoch = 100
model_search_trials = 10
enable_model_size_search = false
[recommend.replacement]
enable_replacement = false
positive_replacement_decay = 0.8
read_replacement_decay = 0.6
[recommend.offline]
check_recommend_period = "1m"
refresh_recommend_period = "120h"
enable_latest_recommend = true
enable_popular_recommend = false
enable_user_based_recommend = true
enable_item_based_recommend = false
enable_collaborative_recommend = true
enable_click_through_prediction = true
explore_recommend = { popular = 0.1, latest = 0.2 }
[recommend.online]
fallback_recommend = ["latest"]
num_feedback_fallback_item_based = 10
[tracing]
enable_tracing = false
exporter = "jaeger"
collector_endpoint = "http://localhost:14268/api/traces"
sampler = "always"
ratio = 1 |
Beta Was this translation helpful? Give feedback.
-
Since you have changed ports in the config file: [master]
+ port = 18086
host = "0.0.0.0"
+ http_port = 18088
http_host = "0.0.0.0" You should map the same ports in gorse:
image: zhenghaoz/gorse-in-one
restart: unless-stopped
ports:
+ - 18086:18086 # gRPC port
+ - 18088:18088 # HTTP port |
Beta Was this translation helpful? Give feedback.
Since you have changed ports in the config file:
You should map the same ports in
docker-compose.yaml