Files
dozzle-monitoring/Dockerfile
Amir Raminfar ee37d7c30e Adds i18n support with vue-i18n (#1870)
* Adds asset changes for i18n

* Adds asset changes for i18n

* Adds vite configs

* Adds auto import and cleans up props

* Initital localzation

* Fixes dockerfile

* Fixes tests

* Updates fixutres

* Updates default lang
2022-09-08 15:40:26 -07:00

61 lines
1.2 KiB
Docker

# Build assets
FROM --platform=$BUILDPLATFORM node:18-alpine as node
RUN npm install -g pnpm
WORKDIR /build
# Install dependencies from lock file
COPY pnpm-lock.yaml ./
RUN pnpm fetch --prod
# Copy files
COPY package.json .* vite.config.ts index.html ./
# Copy assets and translations to build
COPY assets ./assets
COPY locales ./locales
# Install dependencies
RUN pnpm install -r --offline --prod --ignore-scripts && pnpm build
FROM --platform=$BUILDPLATFORM golang:1.19.1-alpine AS builder
RUN apk add --no-cache ca-certificates && mkdir /dozzle
WORKDIR /dozzle
# Copy go mod files
COPY go.* ./
RUN go mod download
# Copy assets built with node
COPY --from=node /build/dist ./dist
# Copy all other files
COPY analytics ./analytics
COPY healthcheck ./healthcheck
COPY docker ./docker
COPY web ./web
COPY main.go ./
# Args
ARG TAG=dev
ARG TARGETOS TARGETARCH
# Build binary
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=$TAG" -o dozzle
FROM scratch
ENV PATH /bin
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /dozzle/dozzle /dozzle
EXPOSE 8080
ENTRYPOINT ["/dozzle"]