mirror of https://github.com/status-im/fathom.git
Merge pull request #48 from Sh4d1/docker
Add working Docker build and run example in README
This commit is contained in:
commit
d3dfde315e
|
@ -1,11 +1,11 @@
|
|||
FROM golang:latest AS compiler
|
||||
WORKDIR /go/src/github.com/usefathom/fathom
|
||||
ADD . /go/src/github.com/usefathom/fathom
|
||||
RUN go get -u github.com/gobuffalo/packr/... && make build
|
||||
RUN go get -u github.com/gobuffalo/packr/... && make docker
|
||||
|
||||
FROM alpine:latest
|
||||
EXPOSE 8080
|
||||
RUN apk add --update --no-cache bash ca-certificates
|
||||
WORKDIR /app
|
||||
COPY --from=compiler /go/src/github.com/usefathom/fathom/fathom .
|
||||
CMD ["./fathom", "server"]
|
||||
RUN apk add --update bash ca-certificates && rm -rf /var/cache/apk/*
|
||||
|
|
4
Makefile
4
Makefile
|
@ -19,6 +19,10 @@ install: $(wildcard *.go) $(GOPATH)/bin/packr
|
|||
.PHONY: build
|
||||
build: $(EXECUTABLE)
|
||||
|
||||
.PHONY: docker
|
||||
docker: $(GO_SOURCES) assets/build
|
||||
GOOS=linux GOARCH=amd64 $(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $(EXECUTABLE) $(MAIN_PKG)
|
||||
|
||||
$(EXECUTABLE): $(GO_SOURCES) assets/build
|
||||
go build -o $@ $(MAIN_PKG)
|
||||
|
||||
|
|
|
@ -22,6 +22,11 @@ For getting a development version of Fathom up & running, go through the followi
|
|||
|
||||
To install and run Fathom in production, [have a look at the installation instructions](https://github.com/usefathom/fathom/wiki/Installing-&-running-Fathom).
|
||||
|
||||
## Building with Docker
|
||||
|
||||
Ensure you have Docker installed and run `docker build -t fathom .`.
|
||||
Run the container with `docker run -d -p 8080:8080 fathom`.
|
||||
|
||||
#### Tracking snippet
|
||||
|
||||
To start tracking, include the following JavaScript on your site and replace `yourfathom.com` with the URL to your Fathom instance.
|
||||
|
|
Loading…
Reference in New Issue