godash/docker/Dockerfile

48 lines
991 B
Text
Raw Normal View History

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/
COPY --from=goBuilder /app/bookmarks/config.yaml ./bookmarks/config.yaml
COPY --from=goBuilder /app/godash .
2023-06-14 21:53:27 +02:00
# Envs
ARG VERSION
ENV VERSION=$VERSION
ARG BUILDTIME
ENV BUILDTIME=$BUILDTIME
2023-06-16 13:19:10 +02:00
ENTRYPOINT ["/app/entrypoint.sh"]