2023-06-14 21:53:27 +02:00
|
|
|
ARG GOLANG_VERSION
|
|
|
|
ARG NODE_VERSION
|
|
|
|
ARG ALPINE_VERSION
|
|
|
|
FROM golang:${GOLANG_VERSION}-alpine AS goBuilder
|
2023-06-16 13:19:10 +02:00
|
|
|
WORKDIR /app
|
2023-06-14 21:53:27 +02:00
|
|
|
|
2023-06-16 13:19:10 +02:00
|
|
|
COPY ./go.mod .
|
|
|
|
COPY ./go.sum .
|
2023-06-14 21:53:27 +02:00
|
|
|
RUN go mod download
|
|
|
|
|
2023-06-16 13:19:10 +02:00
|
|
|
COPY . .
|
|
|
|
RUN go build -ldflags="-s -w" cmd/godash/godash.go
|
2023-06-14 21:53:27 +02:00
|
|
|
|
|
|
|
FROM node:${NODE_VERSION}-alpine AS nodeBuilder
|
|
|
|
|
2023-06-16 13:19:10 +02:00
|
|
|
COPY ./package.json .
|
|
|
|
COPY ./yarn.lock .
|
2023-06-14 21:53:27 +02:00
|
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
|
2023-06-16 13:19:10 +02:00
|
|
|
COPY ./web ./web
|
|
|
|
COPY ./tailwind.config.js .
|
2023-06-14 21:53:27 +02:00
|
|
|
RUN yarn run tailwind:build
|
|
|
|
|
|
|
|
FROM alpine:${ALPINE_VERSION} AS logo
|
|
|
|
RUN apk add figlet
|
|
|
|
RUN figlet GoDash > logo.txt
|
|
|
|
|
|
|
|
FROM alpine:${ALPINE_VERSION} AS final
|
2023-06-16 13:19:10 +02:00
|
|
|
RUN apk add tzdata
|
2023-06-14 21:53:27 +02:00
|
|
|
|
|
|
|
# GoDash
|
2023-06-16 13:19:10 +02:00
|
|
|
WORKDIR /app
|
|
|
|
COPY scripts/entrypoint.sh .
|
2023-06-14 21:53:27 +02:00
|
|
|
|
|
|
|
COPY --from=logo /logo.txt .
|
2023-06-16 13:19:10 +02:00
|
|
|
COPY --from=nodeBuilder /web/static/ ./web/static/
|
|
|
|
COPY --from=nodeBuilder /web/templates ./web/templates/
|
2023-06-21 17:23:40 +02:00
|
|
|
COPY --from=goBuilder /app/internal/bookmarks/config.yaml .internal/bookmarks/config.yaml
|
2023-06-16 13:19:10 +02:00
|
|
|
COPY --from=goBuilder /app/godash .
|
2023-06-14 21:53:27 +02:00
|
|
|
|
|
|
|
# Envs
|
2023-06-27 14:56:31 +02:00
|
|
|
ARG APP_VERSION
|
|
|
|
ENV APP_VERSION=$APP_VERSION
|
|
|
|
ARG BUILD_TIME
|
|
|
|
ENV BUILD_TIME=$BUILD_TIME
|
2023-06-14 21:53:27 +02:00
|
|
|
|
2023-06-16 13:19:10 +02:00
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|