mirror of
https://github.com/dstotijn/hetty
synced 2025-02-16 12:18:28 +00:00
Update Dockerfile
This commit is contained in:
parent
1489cb16bf
commit
73ebb89863
5 changed files with 11 additions and 12 deletions
|
@ -9,7 +9,7 @@ builds:
|
|||
- CGO_ENABLED=0
|
||||
main: ./cmd/hetty
|
||||
ldflags:
|
||||
- -s -w -X main.version=v{{.Version}}
|
||||
- -s -w -X main.version={{.Version}}
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -1,8 +1,6 @@
|
|||
ARG GO_VERSION=1.16
|
||||
ARG NODE_VERSION=14.11
|
||||
ARG ALPINE_VERSION=3.12
|
||||
|
||||
ARG CGO_ENABLED=0
|
||||
ARG GO_VERSION=1.17
|
||||
ARG NODE_VERSION=16.13
|
||||
ARG ALPINE_VERSION=3.15
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS node-builder
|
||||
WORKDIR /app
|
||||
|
@ -13,14 +11,15 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
|||
RUN yarn run export
|
||||
|
||||
FROM golang:${GO_VERSION}-alpine AS go-builder
|
||||
ARG HETTY_VERSION=0.0.0
|
||||
ENV CGO_ENABLED=0
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache build-base
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY cmd ./cmd
|
||||
COPY pkg ./pkg
|
||||
COPY --from=node-builder /app/dist ./cmd/hetty/admin
|
||||
RUN go build ./cmd/hetty
|
||||
RUN go build -ldflags="-s -w -X main.version=${HETTY_VERSION}" ./cmd/hetty
|
||||
|
||||
FROM alpine:${ALPINE_VERSION}
|
||||
WORKDIR /app
|
||||
|
|
|
@ -107,7 +107,7 @@ Usage of ./hetty:
|
|||
You should see:
|
||||
|
||||
```
|
||||
2020/11/01 14:47:10 [INFO] Running server on :8080 ...
|
||||
2022/01/26 10:34:24 [INFO] Hetty (v0.3.2) is running on :8080 ...
|
||||
```
|
||||
|
||||
Then, visit [http://localhost:8080](http://localhost:8080) to get started.
|
||||
|
|
|
@ -27,7 +27,7 @@ import (
|
|||
"github.com/dstotijn/hetty/pkg/scope"
|
||||
)
|
||||
|
||||
var version = "v0.0.0"
|
||||
var version = "0.0.0"
|
||||
|
||||
// Flag variables.
|
||||
var (
|
||||
|
@ -144,7 +144,7 @@ func run() error {
|
|||
TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, // Disable HTTP/2
|
||||
}
|
||||
|
||||
log.Printf("[INFO] Hetty (%v) is running on %v ...", version, addr)
|
||||
log.Printf("[INFO] Hetty (v%v) is running on %v ...", version, addr)
|
||||
|
||||
err = s.ListenAndServe()
|
||||
if err != nil && errors.Is(err, http.ErrServerClosed) {
|
||||
|
|
|
@ -59,7 +59,7 @@ $ hetty
|
|||
You should see:
|
||||
|
||||
```
|
||||
2020/11/01 14:47:10 [INFO] Running server on :8080 ...
|
||||
2022/01/26 10:34:24 [INFO] Hetty (v0.3.2) is running on :8080 ...
|
||||
```
|
||||
|
||||
Then, visit [http://localhost:8080](http://localhost:8080) to get started.
|
||||
|
|
Loading…
Add table
Reference in a new issue