0

I'm trying to set up golang environment as described in this great post. I'm using Docker on OS X 10.10 with boot2docker (v1.3.0) and fig.sh (1.0.1). Everything runs fine, but revel's hot-reload not working at all. Anyone experienced same problem or know any workaround to make hot-reload work? Revel framework version 0.11.1

yoma
  • 1
  • 2
  • What error are you seeing? There's no reason Revel shouldn't run as designed in Docker since Docker provides a shell and filesystem. I'd like to learn more about the problem you're having. – Brenden Jan 05 '15 at 23:38

2 Answers2

0

Boot2docker uses VirtualBox, and I'm assuming vboxsf for shared folders. vboxsf doesn't notify about changed files. Try keeping the files completely inside the virtual machine. Does that help?

ptman
  • 787
  • 13
  • 19
0

How about something like this for a Dockerfile

FROM golang:1.17.2-alpine AS build

# Add required packages
RUN apk add --update git curl bash

# Install revel framework
RUN go get -u github.com/revel/revel
RUN go get -u github.com/revel/cmd/revel

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

ENV CGO_ENABLED 0

ADD . .

ENTRYPOINT revel run

Then run using something like docker compose:

version: '3.9'

services:
  go-revel-crud:
    build:
      context: .
      dockerfile: ./Dockerfile.local
    ports:
      - 8090:8090
    volumes:
      - .:/app
    environment:
      - ENV=dev
      - PORT=8090

Mounting the volume for current directory to the working dir /app.

Checkout this guide with full explaination

Eutychus
  • 442
  • 8
  • 12