tiny-url-ex/Dockerfile

15 lines
399 B
Docker

FROM golang:alpine as builder
ENV GO111MODULE=on
RUN apk add git
ADD . /pkg
WORKDIR /pkg
RUN go get -d ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o exec
FROM redis:alpine
COPY --from=builder /pkg/exec /usr/local/bin/docker-exec
COPY --from=builder /pkg/api.json /usr/local/bin/api.json
RUN printf "docker-exec&" >> /usr/local/bin/docker-entrypoint.sh
EXPOSE 4242/tcp
# CMD ["/main"]