godash/Dockerfile

53 lines
1.2 KiB
Text
Raw Normal View History

2024-03-13 11:51:52 +01:00
ARG V_GOLANG
ARG V_NODE
ARG V_ALPINE
FROM golang:${V_GOLANG}-alpine AS goBuilder
2024-03-12 15:49:08 +01:00
WORKDIR /app
RUN go install github.com/a-h/templ/cmd/templ@latest
COPY ./go.mod .
COPY ./go.sum .
RUN go mod download
COPY . .
RUN templ generate
RUN go build -ldflags="-s -w" -o godash main.go
2024-03-13 11:51:52 +01:00
FROM node:${V_NODE}-alpine AS nodeBuilder
2024-03-12 15:49:08 +01:00
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --network-timeout 30000
COPY assets/css ./assets/css
COPY components ./components
COPY views ./views
COPY tailwind.config.js .
RUN yarn run tw:build
2024-03-13 11:51:52 +01:00
FROM alpine:${V_ALPINE} AS logo
2024-03-12 15:49:08 +01:00
WORKDIR /app
RUN apk add figlet
RUN figlet GoDash > logo.txt
2024-03-13 11:51:52 +01:00
FROM alpine:${V_ALPINE} AS final
2024-03-12 15:49:08 +01:00
WORKDIR /app
RUN apk add tzdata
COPY scripts/entrypoint.sh .
2024-03-12 16:30:41 +01:00
COPY assets/favicon ./assets/favicon
2024-03-12 15:49:08 +01:00
COPY --from=logo /app/logo.txt .
COPY --from=nodeBuilder /app/assets/css/style.css ./assets/css/style.css
2024-06-11 11:32:53 +02:00
COPY --from=nodeBuilder /app/node_modules/simple-icons/icons ./node_modules/simple-icons/icons
2024-03-12 15:49:08 +01:00
COPY --from=goBuilder /app/views ./views
COPY --from=goBuilder /app/components ./components
COPY --from=goBuilder /app/godash .
ARG APP_VERSION
ENV APP_VERSION=$APP_VERSION
ENTRYPOINT ["/app/entrypoint.sh"]