Coder Social home page Coder Social logo

go-docker-example's Introduction

Build Status

Go-Docker-Example

solution

The solution is composed of two service plus a database used to store and search data.

Three docker containers are necessary to run locally:

  1. client api
  2. port service (serving a grpc service)
  3. mongodb

what i have used so far:

grpc, mongodb with full text search, echo lib to rest api, github actions to ci, docker hub and docker containers, make file, a couple of shell scripts,ddd.

how to run

Before you run, please change the docker-compose.yaml file appropriately with the right folder path to the json file.

#client api service
volumes:
  #do not add the file name here, only the path
  - /path/to/your/json/file/:/go/file/

just execute run.sh

Check the logs

docker logs <clientapi-container-name> -f
docker logs <portservice-container-name> -f

over each project folder you can execute the command to see what is available, like this:

make
โœ“ usage: make [target]

build-common                   - execute build common tasks clean and mod tidy
build-debug                    - build a debug binary to the current platform (windows, linux or darwin(mac))
build-release                  - build a release linux elf(binary)
build-static-release           - build a static release linux elf(binary)
ci-lint                        - runs golangci-lint
docker-build                   - build docker image
docker-scan                    - Scan for known vulnerabilities
generate-go-proto              - generate golang proto files
help                           - Show this help message
sonar-scan                     - runs build and then sonar scanner (make sure you have installed sonar-scanner and you have it in your path)
sonar-start                    - start sonar qube locally with docker (you will need docker installed in your machine)
sonar-stop                     - stop sonar qube docker container
test                           - execute go test command

What can be improved

configuration, failure recovery, unit test, add more features, usage of k3d for kubernetes local deployment.

go-docker-example's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.