This commit is contained in:
Florian Hoss 2023-07-04 11:51:13 +02:00
commit f90fdc0598
99 changed files with 15260 additions and 0 deletions

51
docker/Dockerfile Normal file
View file

@ -0,0 +1,51 @@
ARG GOLANG_VERSION
ARG NODE_VERSION
ARG ALPINE_VERSION
FROM golang:${GOLANG_VERSION}-alpine AS goBuilder
RUN apk add cmake g++ gcc
WORKDIR /app
COPY ./swagger.sh .
RUN ./swagger.sh install
COPY ./go.mod .
COPY ./go.sum .
RUN go mod download
COPY . .
RUN ./swagger.sh init
RUN go build -ldflags="-s -w"
FROM node:${NODE_VERSION}-alpine AS nodeBuilder
WORKDIR /app
COPY ./frontend/package.json .
COPY ./frontend/yarn.lock .
RUN yarn install --frozen-lockfile
COPY --from=goBuilder /app/docs/swagger.json ../docs/swagger.json
COPY ./frontend/ .
RUN yarn run types:openapi
RUN yarn run build
FROM alpine:${ALPINE_VERSION} AS logo
RUN apk add figlet
RUN figlet Cafe > logo.txt
FROM alpine:${ALPINE_VERSION} AS final
RUN apk add tzdata
WORKDIR /app
COPY ./scripts/entrypoint.sh .
COPY --from=logo /logo.txt .
COPY --from=nodeBuilder /app/dist/ ./templates/
COPY --from=goBuilder /app/cafe .
COPY config.toml .
ARG VERSION
ENV VERSION=$VERSION
ARG BUILD_TIME
ENV BUILD_TIME=$BUILD_TIME
ENTRYPOINT ["/app/entrypoint.sh"]