Skip to content

Instantly share code, notes, and snippets.

@charlires
Last active July 21, 2021 00:55
Show Gist options
  • Save charlires/66a5cfbfe65026175cfa74ddb9290ca6 to your computer and use it in GitHub Desktop.
Save charlires/66a5cfbfe65026175cfa74ddb9290ca6 to your computer and use it in GitHub Desktop.
Dockerfiles
FROM golang:buster as build
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-mod=vendor -ldflags "-s -w" -a -installsuffix cgo -o bin .
## Install shush
RUN mkdir -p /usr/local/bin/
RUN curl -sL -o /usr/local/bin/shush \
https://github.com/realestate-com-au/shush/releases/download/v1.3.4/shush_linux_amd64 \
&& chmod +x /usr/local/bin/shush
# Build image with binary
FROM scratch
COPY --from=build /usr/local/bin/shush .
COPY --from=build /app/bin .
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENTRYPOINT ["./shush", "--region=us-east-1", "exec", "--"]
CMD ["./bin"]
# git config --global url."https://$USER:[email protected]/".insteadOf "https://github.com/"
# go get github.com/jstemmer/go-junit-report
# go get github.com/golangci/golangci-lint/cmd/[email protected]
# go mod vendor
# golangci-lint run ./... --config=.golangci.yml
# go test ./... -v -race | go-junit-report > report.xml
# go test ./... -coverprofile=../c.out && go tool cover -html=../c.out -o ../coverage.html && cat ../coverage.html > coverage.html
FROM node:8-alpine
# https://www.npmjs.com/package/http-server
RUN npm install -g http-server
WORKDIR /site
ADD ./ /site
EXPOSE 8080
ENTRYPOINT ["http-server", "--cors", "-p8080", "/site"]
# docker build --tag static-server .
# docker run -p 8080:8080 static-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment