Skip to content

Commit e95fe48

Browse files
authored
Merge pull request #358 from bavix/optimize
Refactor Dockerfile to build Go application with UPX compression and update Go version in go.mod to 1.25
2 parents fb575ae + 7bf8a10 commit e95fe48

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

Dockerfile

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1-
FROM rtsp/lighttpd
2-
COPY ./public /var/www/html/
3-
EXPOSE 80/tcp
1+
FROM golang:1.25-alpine AS builder
2+
3+
WORKDIR /app
4+
5+
RUN apk add --no-cache upx
6+
7+
COPY go.mod ./
8+
RUN go mod tidy
9+
10+
COPY . .
11+
12+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o server .
13+
14+
RUN upx --best --lzma /app/server
15+
16+
FROM scratch
17+
18+
COPY --from=builder /app/server /server
19+
20+
EXPOSE 8080
21+
ENTRYPOINT ["/server"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ npm run preview
2020

2121
Docker:
2222
```sh
23-
docker run -p 8080:80 -d bavix/uuid-ui
23+
docker run -p 8080:8080 -d bavix/uuid-ui
2424
```
2525
or
2626
```sh
27-
docker run -p 8080:80 -d ghcr.io/bavix/uuid-ui
27+
docker run -p 8080:8080 -d ghcr.io/bavix/uuid-ui
2828
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/bavix/uuid-ui
22

3-
go 1.21.1
3+
go 1.25

0 commit comments

Comments
 (0)