33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
FROM golang:1.23.4@sha256:b01f7c744a3f1fccaf44905169169fed0ab13e6d1d702a6542d07b34cf677969 AS builder_go
|
|
WORKDIR /me-fit
|
|
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2
|
|
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 /me-fit/me-fit .
|
|
|
|
|
|
FROM node:22.12.0@sha256:0e910f435308c36ea60b4cfd7b80208044d77a074d16b768a81901ce938a62dc AS builder_node
|
|
WORKDIR /me-fit
|
|
COPY package.json package-lock.json ./
|
|
RUN npm clean-install
|
|
COPY . ./
|
|
RUN npm run build
|
|
|
|
|
|
FROM debian:12.8@sha256:b877a1a3fdf02469440f1768cf69c9771338a875b7add5e80c45b756c92ac20a
|
|
WORKDIR /me-fit
|
|
RUN apt-get update && apt-get install -y ca-certificates && echo "" > .env
|
|
COPY migration ./migration
|
|
COPY --from=builder_go /me-fit/me-fit ./me-fit
|
|
COPY --from=builder_node /me-fit/static ./static
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/me-fit/me-fit"]
|
|
|