rch9 / cloudbilling

X Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

cloudbilling

X Project

Install

make install

  • creates a volume to persist postgres data
  • builds base golang image (used for run commands)

Start the app:

make up / make down - start/stop the app on port 8080 in dev mode with docker-compose (no hot-reload yet)

Debug:

make debug / make debug-down - start/stop the app in debug mode

to attach from vscode add the following configuration to .vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Docker debug",
            "type": "go",
            "request": "launch",
            "mode": "remote",
            "remotePath": "/go/src/github.com/radisvaliullin/cloudbilling/cmd/cloudbilling",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${workspaceRoot}/cmd/cloudbilling",
            "env": {},
            "args": ["-v"],
            "showLog": true,
            "trace": "verbose"
        },
    ]
}

Tests:

make unit-test
make integration-test

Db:

make db/run - standalone postgresdb container.

Various commands (probably useful for CI)

make lint
make cover

(sections should be moved to wiki)

Useful docker commands

docker exec -it {container_name} sh //attach to a running container in interactive mode and run shell

Remove ALL containers, images and volumes:

docker rm $(docker ps -a -q)
docker rmi $(docker images -q)    
docker volume rm $(docker volume ls -qf dangling=true)

About

X Project

License:MIT License


Languages

Language:Go 94.9%Language:Makefile 3.0%Language:Shell 0.8%Language:Dockerfile 0.7%Language:PLpgSQL 0.6%