From e8c2d939d1a267223d81992489a6325a48d2cae1 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 25 Apr 2024 18:22:24 +0300 Subject: [PATCH] use docker-compose instead of docker --- README.md | 8 ++------ docker-compose.yaml | 12 ++++++++++++ server/handler.go | 2 -- 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 docker-compose.yaml diff --git a/README.md b/README.md index ca0e53b..c80ac5c 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,7 @@ Example: ``` ## How to run: -1. Build the docker container: +1. Run docker-compose file: ```bash - docker build -t refresh-service:local . - ``` -2. Run the docker container: - ```bash - docker run --env-file .env -v ./config.yaml:/app/config.yaml -p 8002:8002 refresh-service:local + docker-compose up -d ``` diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0d6bfcb --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '3' +services: + refresh-service: + build: + context: . + dockerfile: Dockerfile + volumes: + - ./config.yaml:/app/config.yaml:ro + ports: + - 8002:8002 + env_file: + - .env \ No newline at end of file diff --git a/server/handler.go b/server/handler.go index cc1b91d..d4189de 100644 --- a/server/handler.go +++ b/server/handler.go @@ -3,7 +3,6 @@ package server import ( "io" "net/http" - "strings" "time" "github.com/0xPolygonID/refresh-service/logger" @@ -65,7 +64,6 @@ func (h *Handlers) Run(host string) error { } }) - host = strings.Trim(host, "\"") logger.DefaultLogger.Infof("Server starting on host '%s'", host) httpServer := &http.Server{ Addr: host,