mirror of
https://github.com/AnalogJ/scrutiny.git
synced 2026-02-19 23:36:21 -05:00
Closes #872 * update go to 1.25 * update deprecated gomock * remove deprecated ioutil * update (and fix) ci * add golang lint (as warning) * enable formatters + freeze golang version
38 lines
1.4 KiB
Docker
38 lines
1.4 KiB
Docker
# syntax=docker/dockerfile:1.4
|
|
########################################################################################################################
|
|
# Web Image
|
|
########################################################################################################################
|
|
|
|
######## Build the frontend
|
|
FROM --platform=${BUILDPLATFORM} node AS frontendbuild
|
|
WORKDIR /go/src/github.com/analogj/scrutiny
|
|
COPY --link . /go/src/github.com/analogj/scrutiny
|
|
|
|
RUN make binary-frontend
|
|
|
|
######## Build the backend
|
|
FROM golang:1.25-bookworm as backendbuild
|
|
|
|
WORKDIR /go/src/github.com/analogj/scrutiny
|
|
COPY --link . /go/src/github.com/analogj/scrutiny
|
|
|
|
RUN apt-get update && apt-get install -y file && rm -rf /var/lib/apt/lists/*
|
|
RUN make binary-clean binary-all WEB_BINARY_NAME=scrutiny
|
|
|
|
|
|
######## Combine build artifacts in runtime image
|
|
FROM debian:bookworm-slim as runtime
|
|
EXPOSE 8080
|
|
WORKDIR /opt/scrutiny
|
|
ENV PATH="/opt/scrutiny/bin:${PATH}"
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates curl tzdata && rm -rf /var/lib/apt/lists/* && update-ca-certificates
|
|
|
|
COPY --link --from=backendbuild --chmod=755 /go/src/github.com/analogj/scrutiny/scrutiny /opt/scrutiny/bin/
|
|
COPY --link --from=frontendbuild --chmod=644 /go/src/github.com/analogj/scrutiny/dist /opt/scrutiny/web
|
|
RUN mkdir -p /opt/scrutiny/web && \
|
|
mkdir -p /opt/scrutiny/config && \
|
|
chmod -R a+rX /opt/scrutiny && \
|
|
chmod -R a+w /opt/scrutiny/config
|
|
CMD ["/opt/scrutiny/bin/scrutiny", "start"]
|