diff --git a/freva-rest/Dockerfile b/freva-rest/Dockerfile index e6a504d..acd959a 100644 --- a/freva-rest/Dockerfile +++ b/freva-rest/Dockerfile @@ -39,4 +39,4 @@ COPY docker-scripts/logging.sh /usr/local/lib/logging.sh RUN mkdir -p /logs && chmod -R 2666 /logs ENTRYPOINT ["/docker-entrypoint-initdb.d/entrypoint.sh"] -CMD python3 -m freva_rest.cli +CMD ["freva-rest-server"] diff --git a/freva-rest/README.md b/freva-rest/README.md index cc39ad7..646bf4a 100644 --- a/freva-rest/README.md +++ b/freva-rest/README.md @@ -47,7 +47,7 @@ You can pull the container from the GitHub container registry: docker pull ghcr.io/freva-clint/freva-rest:latest ``` -By default the container starts with the ``freva-rest-service`` command. +By default the container starts with the ``freva-rest-server`` command. See the `freva-rest-server --help` command for configure options. ### Server Startup Options diff --git a/freva-rest/docker-scripts/follow b/freva-rest/docker-scripts/follow index 486f287..8a874b9 100755 --- a/freva-rest/docker-scripts/follow +++ b/freva-rest/docker-scripts/follow @@ -8,21 +8,32 @@ VALID_SERVICES=("mysql" "mongodb" "redis" "solr") logs=() for service in "$@"; do service_lower=$(echo "$service" | tr '[:upper:]' '[:lower:]') - if [[ " ${VALID_SERVICES[*]} " =~ " $service_lower " ]]; then - log_file="/logs/${service_lower}.log" + case "${service_lower}" in + "mongo"|"mongodb"|"mongod") + log_file="/logs/mongodb.log" + ;; + "mysql"|"mysqld") + log_file="/logs/mysqld.log" + ;; + "redis") + log_file="/logs/reids.log" + ;; + "solr") + log_file="/logs/solr.log" + ;; + "*") + log_error "Error: '$service' is not a valid service. Allowed: ${VALID_SERVICES[*]}" + exit 1 + esac if [[ -f "$log_file" ]]; then logs+=("$log_file") else - log_warn Log file for '$service_lower' does not exist: $log_file" + log_warn "Log file for '$service_lower' does not exist: $log_file" fi - else - log_error "Error: '$service' is not a valid service. Allowed: ${VALID_SERVICES[*]}" - exit 1 - fi done if [[ ${#logs[@]} -eq 0 ]]; then log_error "No valid services provided. Allowed: ${VALID_SERVICES[*]}" exit 1 fi - +log_info "Following $@" tail -f "${logs[@]}"