Skip to content

Commit

Permalink
Merge pull request dunglas#209 from dunglas/docker
Browse files Browse the repository at this point in the history
Fix Docker image
  • Loading branch information
dunglas authored Nov 7, 2019
2 parents 904acdd + 10268ca commit ee9309b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install:

script:
- golangci-lint run ./...
- go build
- CGO_ENABLED=0 GOOS=linux go build -v -a -ldflags '-extldflags "-static"' .
- $GOPATH/bin/goveralls -race -service=travis-ci
after_success:
- test -n "$TRAVIS_TAG" && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
Expand Down
28 changes: 4 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
# First stage: build the app
FROM golang:1 as build

ENV GO111MODULE on
WORKDIR /go/src/app

# Copy go mod and sum files
COPY go.mod go.sum ./

# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download

COPY ./ .

RUN go get -v
RUN CGO_ENABLED=0 GOOS=linux go build -v -a -ldflags '-extldflags "-static"' .
RUN chmod +x ./mercure

# Build the actual image
FROM scratch
COPY --from=build /go/src/app/mercure .
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY public ./public/
CMD ["./mercure"]
FROM gcr.io/distroless/static
COPY mercure /
COPY public /public/
CMD ["/mercure"]
EXPOSE 80 443
8 changes: 8 additions & 0 deletions docs/UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Upgrade

## 0.8

* According to the new version of the spec, the URL of the Hub changed moved from `/hub` to `/.well-known/mercure`
* `HISTORY_CLEANUP_FREQUENCY` and `DB_PATH` environment variables have been replaced by the new `TRANSPORT_URL` environment variable
* Lists in `ACME_HOSTS`, `CORS_ALLOWED_ORIGINS`, `PUBLISH_ALLOWED_ORIGINS` must now be space separated
* The public API of the Go library has been totally revamped

0 comments on commit ee9309b

Please sign in to comment.