33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
FROM golang:1.23.3@sha256:e5ca1999e21764b1fd40cf6564ebfb7022e7a55b8c72886a9bcb697a5feac8d6 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.11.0@sha256:ec878c763e9fad09d22aae86e2edcb7a05b397dfe8411c16e2b90158d595e2ce 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:17122fe3d66916e55c0cbd5bbf54bb3f87b3582f4d86a755a0fd3498d360f91b
|
|
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"]
|
|
|