Skip to content

GRPC & HTTP API for Digital Transformation Leaders 2021 contest

Notifications You must be signed in to change notification settings

techpotion/leaders2021-backend

Repository files navigation

Sport Object Analysis

Depolyment

  1. Clone repository and "cd" in it
$ git clone https://github.com/techpotion/leaders2021-backend.git
$ cd leaders2021-backend
  1. Fill the config.yaml, according to config.example.yaml example
server:
  grpc:
    interface: 0.0.0.0
    port: 3200
  http:
    interface: 0.0.0.0
    port: 3201

microservices:
  marks:
    host: 192.168.1.58
    port: 3300

database:
  host: 192.168.1.58
  port: 5432
  username: postgres
  password: postgres
  db: postgres

Alternatively, you may set database connection data using environment variables

$ export DB_DB=postgis
$ export DB_HOST=localhost
$ export DB_PORT=5432
$ export DB_USERNAME=postgis
$ export DB_PASSWORD=postgis
$ export MARKS_HOST=localhost
$ export MARKS_PORT=3300
$ export EXPORTS_HOST=localhost
$ export EXPORTS_PORT=3400

* Environment variables take precedence over data in config.yaml file

  1. Install Golang if you need to - https://golang.org/doc/install

  2. Install project's dependencies

$ go mod download
  1. Run the project
$ go run main.go

Depolyment using Docker

  1. Clone repository and "cd" in it
$ git clone https://github.com/techpotion/leaders2021-backend.git
$ cd leaders2021-backend
  1. Build the docker image
$ docker build --tag backend .
  1. Run the project passing database data as environment variables via -e argument
$ docker run -d -p 3200:3200 -p 3201:3201 --name techpotion-leaders2021-backend -e DB_DB=postgis -e DB_HOST=192.168.1.58 -e DB_PORT=5542 -e DB_USERNAME=postgis -e DB_PASSWORD=postgis backend

About

GRPC & HTTP API for Digital Transformation Leaders 2021 contest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages