feat:#36 added protobuf communication for modules

This commit is contained in:
Elmar Kresse
2024-06-17 00:59:33 +02:00
parent 8548a537ec
commit fad85f2884
18 changed files with 1286 additions and 59 deletions

View File

@@ -19,12 +19,14 @@ FROM golang:alpine AS build
WORKDIR /app
RUN apk add --no-cache --update go gcc g++
# Copy the source from the current directory to the Working Directory inside the container
COPY . ./
# download needed modules
RUN apk add --no-cache --update go gcc g++ && \
go mod download && \
CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager
COPY go.mod go.sum ./
RUN go mod download
COPY data-manager/. ./data-manager
COPY common/. ./common
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager data-manager/main.go
# production stage
FROM alpine:latest AS prod
@@ -44,7 +46,7 @@ COPY --chown=$USER:$USER --from=build /htwkalender-data-manager ./
# Expose port 8090 to the outside world
EXPOSE 8090
ENTRYPOINT ["./htwkalender-data-manager", "serve"]
ENTRYPOINT ["./main", "serve"]
FROM golang:1.21.6 AS dev
@@ -53,18 +55,18 @@ FROM golang:1.21.6 AS dev
WORKDIR /htwkalender-data-manager
# Copy go mod and sum files
# COPY ../go.mod ../go.sum ./
# RUN go mod download
COPY go.mod go.sum ./
RUN go mod download
# Copy the source from the current directory to the Working Directory inside the container
COPY *.go ./
COPY . .
COPY data-manager/. ./data-manager
COPY common/. ./common
# Build the Go app
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager data-manager/main.go
# Expose port 8090 to the outside world
EXPOSE 8090
# Expose port 8091 to the outside world
EXPOSE 8091
# Entry point
ENTRYPOINT ["./htwkalender-data-manager", "serve"]
ENTRYPOINT ["./main", "serve"]