Last active
July 21, 2021 00:55
-
-
Save charlires/66a5cfbfe65026175cfa74ddb9290ca6 to your computer and use it in GitHub Desktop.
Dockerfiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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