2022-09-21 19:57:38 -06:00
|
|
|
FROM node:18.9.0 as frontend-build
|
|
|
|
WORKDIR /usr/src/fastenhealth/frontend
|
|
|
|
#COPY frontend/package.json frontend/yarn.lock ./
|
|
|
|
COPY frontend/package.json ./
|
|
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
COPY frontend/ ./
|
|
|
|
RUN yarn run build -- --output-path=../dist
|
|
|
|
|
|
|
|
FROM golang:1.18 as backend-build
|
|
|
|
WORKDIR /go/src/github.com/fastenhealth/fastenhealth-onprem
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN go mod vendor \
|
|
|
|
&& go install github.com/golang/mock/mockgen@v1.6.0 \
|
|
|
|
&& go generate ./... \
|
|
|
|
&& go vet ./... \
|
|
|
|
&& go test ./...
|
|
|
|
RUN CGO_ENABLED=0 go build -o /go/bin/fasten ./backend/cmd/fasten/
|
|
|
|
|
2022-09-26 23:14:29 -06:00
|
|
|
# create folder structure
|
|
|
|
RUN mkdir -p /opt/fasten/db \
|
|
|
|
mkdir -p /opt/fasten/web \
|
|
|
|
mkdir -p /opt/fasten/config
|
|
|
|
|
2022-09-21 19:57:38 -06:00
|
|
|
|
2022-09-26 23:14:29 -06:00
|
|
|
|
|
|
|
FROM gcr.io/distroless/static-debian11
|
|
|
|
WORKDIR /opt/fasten/
|
|
|
|
COPY --from=backend-build /opt/fasten/ /opt/fasten/
|
|
|
|
COPY --from=frontend-build /usr/src/fastenhealth/dist /opt/fasten/web
|
2022-09-21 19:57:38 -06:00
|
|
|
COPY --from=backend-build /go/bin/fasten /opt/fasten/fasten
|
2022-09-25 12:14:00 -06:00
|
|
|
COPY LICENSE.md /opt/fasten/LICENSE.md
|
2022-09-26 23:14:29 -06:00
|
|
|
COPY config.yaml /opt/fasten/config/config.yaml
|
2022-09-26 23:16:58 -06:00
|
|
|
CMD ["/opt/fasten/fasten", "start", "--config", "/opt/fasten/config/config.yaml"]
|