1
Fork 0
GoShort/Dockerfile

15 lines
347 B
Docker
Raw Normal View History

2021-09-04 08:43:01 +00:00
FROM golang:1.17-alpine3.14 as build
2020-03-29 08:48:43 +00:00
WORKDIR /app
RUN apk add --no-cache git gcc musl-dev
ADD *.go go.mod go.sum /app/
ADD templates/ /app/templates/
2021-08-10 20:34:25 +00:00
RUN go test -cover ./...
RUN go build -ldflags '-w -s' -o goshort
2020-03-29 08:48:43 +00:00
2021-08-10 20:34:25 +00:00
FROM alpine:3.14
2020-03-29 08:48:43 +00:00
WORKDIR /app
VOLUME /app/config
VOLUME /app/data
EXPOSE 8080
2021-08-10 20:34:25 +00:00
CMD ["goshort"]
COPY --from=build /app/goshort /bin/