mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
Update Dockerfile
This commit is contained in:
@ -9,7 +9,7 @@ builds:
|
|||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
main: ./cmd/hetty
|
main: ./cmd/hetty
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version=v{{.Version}}
|
- -s -w -X main.version={{.Version}}
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
|
13
Dockerfile
13
Dockerfile
@ -1,8 +1,6 @@
|
|||||||
ARG GO_VERSION=1.16
|
ARG GO_VERSION=1.17
|
||||||
ARG NODE_VERSION=14.11
|
ARG NODE_VERSION=16.13
|
||||||
ARG ALPINE_VERSION=3.12
|
ARG ALPINE_VERSION=3.15
|
||||||
|
|
||||||
ARG CGO_ENABLED=0
|
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS node-builder
|
FROM node:${NODE_VERSION}-alpine AS node-builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -13,14 +11,15 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
|||||||
RUN yarn run export
|
RUN yarn run export
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine AS go-builder
|
FROM golang:${GO_VERSION}-alpine AS go-builder
|
||||||
|
ARG HETTY_VERSION=0.0.0
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache build-base
|
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY cmd ./cmd
|
COPY cmd ./cmd
|
||||||
COPY pkg ./pkg
|
COPY pkg ./pkg
|
||||||
COPY --from=node-builder /app/dist ./cmd/hetty/admin
|
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}
|
FROM alpine:${ALPINE_VERSION}
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -107,7 +107,7 @@ Usage of ./hetty:
|
|||||||
You should see:
|
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.
|
Then, visit [http://localhost:8080](http://localhost:8080) to get started.
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
"github.com/dstotijn/hetty/pkg/scope"
|
"github.com/dstotijn/hetty/pkg/scope"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "v0.0.0"
|
var version = "0.0.0"
|
||||||
|
|
||||||
// Flag variables.
|
// Flag variables.
|
||||||
var (
|
var (
|
||||||
@ -144,7 +144,7 @@ func run() error {
|
|||||||
TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, // Disable HTTP/2
|
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()
|
err = s.ListenAndServe()
|
||||||
if err != nil && errors.Is(err, http.ErrServerClosed) {
|
if err != nil && errors.Is(err, http.ErrServerClosed) {
|
||||||
|
@ -59,7 +59,7 @@ $ hetty
|
|||||||
You should see:
|
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.
|
Then, visit [http://localhost:8080](http://localhost:8080) to get started.
|
||||||
|
Reference in New Issue
Block a user