1
Fork 0
GoShort/Dockerfile

17 lines
523 B
Docker
Raw Normal View History

2021-08-10 20:34:25 +00:00
FROM golang:1.16-alpine3.14 as build
2020-03-29 08:48:43 +00:00
WORKDIR /app
2021-08-10 20:34:25 +00:00
ENV GOFLAGS="-tags=linux,libsqlite3"
RUN apk add --no-cache git gcc musl-dev
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main sqlite-dev
ADD . /app
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"]
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main sqlite-dev
COPY --from=build /app/goshort /bin/