33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
FROM golang:1.24.5@sha256:a9219eb99cd2951b042985dbec09d508b3ddc20c4da52a3a55b275b3779e4a05 AS builder_go
|
|
WORKDIR /web-app-template
|
|
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
RUN go install github.com/a-h/templ/cmd/templ@latest
|
|
RUN go install github.com/vektra/mockery/v2@latest
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . ./
|
|
RUN templ generate
|
|
RUN mockery --log-level warn
|
|
RUN go test ./...
|
|
RUN golangci-lint run ./...
|
|
RUN go build -o /web-app-template/web-app-template .
|
|
|
|
|
|
FROM node:22.17.0@sha256:2fa6c977460b56d4d8278947ab56faeb312bc4cc6c4cf78920c6de27812f51c5 AS builder_node
|
|
WORKDIR /web-app-template
|
|
COPY package.json package-lock.json ./
|
|
RUN npm clean-install
|
|
COPY . ./
|
|
RUN npm run build
|
|
|
|
|
|
FROM debian:12.11@sha256:d42b86d7e24d78a33edcf1ef4f65a20e34acb1e1abd53cabc3f7cdf769fc4082
|
|
WORKDIR /web-app-template
|
|
RUN apt-get update && apt-get install -y ca-certificates && echo "" > .env
|
|
COPY migration ./migration
|
|
COPY --from=builder_go /web-app-template/web-app-template ./web-app-template
|
|
COPY --from=builder_node /web-app-template/static ./static
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/web-app-template/web-app-template"]
|
|
|