Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.22-alpine AS build
WORKDIR /src
COPY go.mod ./
COPY . .
RUN CGO_ENABLED=0 go build -o /out/urlshort ./cmd/server

FROM gcr.io/distroless/static-debian12
COPY --from=build /out/urlshort /urlshort
EXPOSE 8080
ENTRYPOINT ["/urlshort"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ go run ./cmd/server
The server listens on `:8080` by default; override with the `ADDR` environment
variable.

### Docker

```sh
docker build -t urlshort .
docker run --rm -p 8080:8080 urlshort
```

## API

| Method | Path | Description |
Expand Down
Loading