This commit is contained in:
4rkal 2024-09-12 21:34:38 +03:00
parent 64dcf4614e
commit 77e78d0373
2 changed files with 30 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
/tmp
*.log
.git
.gitignore
README.md

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
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"]