mirror of
https://github.com/4rkal/shortr.git
synced 2025-01-19 15:03:38 +02:00
25 lines
314 B
Docker
25 lines
314 B
Docker
|
FROM golang:1.23-alpine AS builder
|
||
|
|
||
|
ENV GO111MODULE=on \
|
||
|
CGO_ENABLED=0 \
|
||
|
GOOS=linux \
|
||
|
GOARCH=amd64
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
COPY go.mod go.sum ./
|
||
|
RUN go mod download
|
||
|
|
||
|
COPY . .
|
||
|
|
||
|
RUN go build -o /shortr ./cmd/main.go
|
||
|
|
||
|
FROM alpine:latest
|
||
|
|
||
|
WORKDIR /
|
||
|
|
||
|
COPY --from=builder /shortr /shortr
|
||
|
|
||
|
EXPOSE 8080
|
||
|
|
||
|
CMD ["/shortr"]
|