Skip to content
Docker image for auto-recompiling and auto-restarting Golang server
Dockerfile Shell
Branch: master
Clone or download
Boban Acimovic
Boban Acimovic tag golang to 1.12.6
Latest commit 945ffce Jun 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode fix badges Oct 15, 2018
Dockerfile tag golang to 1.12.6 Jun 13, 2019
LICENSE Initial commit Oct 15, 2018
README.md
build.sh add run arguments Feb 24, 2019
reflex.conf initial commit Oct 15, 2018

README.md

Docker image for auto-recompiling and auto-restarting Golang server

GitHub GitHub tag Docker Automated build Docker Build Status

Features

  • uses Go modules (Go version >=1.11)
  • uses cespare/reflex to watch .go files changes and recompile/restart your server application
  • optionally compiles binary with data race detector

Feature requests

Requirements

  • your server application is expected to run on port 3000 inside the container, but you can actually use any port

Support on Beerpay

Beerpay Beerpay

How to use

Place docker-compose.yml in your project root and run 'docker-compose up --build'.

docker-compose.yml example

version: "3.7"

services:
  myservice:
    image: acim/go-reflex
    environment:
      - RACE_DETECTOR=1
      - RUN_ARGS=server
    volumes:
      - .:/app
    ports:
      - 3000:3000

Optional environment variables

  • RACE_DETECTOR=1 - used to turn on data race detector in the compiled binary
  • RUN_ARGS - used to add commands and flags in the call of your binary
You can’t perform that action at this time.