build: generate templ files inside docker build
This commit is contained in:
@@ -5,11 +5,17 @@ WORKDIR /app
|
|||||||
# Enable CGO for sqlite3
|
# Enable CGO for sqlite3
|
||||||
ENV CGO_ENABLED=1
|
ENV CGO_ENABLED=1
|
||||||
|
|
||||||
|
# Install templ
|
||||||
|
RUN go install github.com/a-h/templ/cmd/templ@latest
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Generate templ files
|
||||||
|
RUN templ generate
|
||||||
|
|
||||||
# Build the server and the CLI tools
|
# Build the server and the CLI tools
|
||||||
RUN go build -o main_server ./cmd/server
|
RUN go build -o main_server ./cmd/server
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user