feat:#36 added protobuf for golang microservices

This commit is contained in:
Elmar Kresse
2024-06-16 02:54:50 +02:00
parent a56c17e945
commit 8548a537ec
55 changed files with 186 additions and 990 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-ical
COPY go.mod go.sum ./
RUN go mod download
COPY ical/*.go ./ical/
COPY ical/. ./ical
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-ical ical/main.go
# production stage
FROM alpine:latest AS prod
@@ -57,14 +59,14 @@ 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 ical/*.go ./ical/
COPY ical/. ./ical
# Build the Go app
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-ical
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-ical ical/main.go
# Expose port 8091 to the outside world
EXPOSE 8091
# Entry point
ENTRYPOINT ["./htwkalender-ical"]
ENTRYPOINT ["./main"]