mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-16 09:38:49 +02:00
add k8s deployment, improved Dockerfiles and docker-compose.yaml files
This commit is contained in:
@ -48,34 +48,4 @@ RUN chmod +x main
|
||||
EXPOSE 8090
|
||||
|
||||
ENTRYPOINT ["./main", "serve"]
|
||||
|
||||
|
||||
FROM golang:1.23 AS dev
|
||||
|
||||
# Set the Current Working Directory inside the container
|
||||
WORKDIR /htwkalender-data-manager
|
||||
|
||||
ARG USER=ical
|
||||
RUN adduser "$USER" && \
|
||||
chown "$USER":"$USER" ./ \
|
||||
&& mkdir -p /htwkalender-data-manager/data \
|
||||
&& chown "$USER":"$USER" /htwkalender-data-manager/data
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy the source from the current directory to the Working Directory inside the container
|
||||
COPY data-manager/. ./data-manager
|
||||
COPY common/. ./common
|
||||
|
||||
# Build the Go app
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -o /htwkalender-data-manager data-manager/main.go
|
||||
|
||||
# Expose port 8091 to the outside world
|
||||
EXPOSE 8091
|
||||
|
||||
USER $USER
|
||||
|
||||
# Entry point
|
||||
ENTRYPOINT ["./main", "serve"]
|
||||
CMD ["--http=0.0.0.0:8090", "--dir=/htwkalender-data-manager/data/pb_data"]
|
||||
|
@ -47,26 +47,3 @@ COPY --chown=$USER:$USER --from=build /htwkalender-ical ./
|
||||
EXPOSE 8091
|
||||
|
||||
ENTRYPOINT ["./main"]
|
||||
|
||||
|
||||
FROM golang:1.23 AS dev
|
||||
|
||||
# Set the Current Working Directory inside the container
|
||||
WORKDIR /htwkalender-ical
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy the source from the current directory to the Working Directory inside the container
|
||||
COPY ical/. ./ical
|
||||
COPY common/. ./common
|
||||
|
||||
# Build the Go app
|
||||
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 ["./main"]
|
Reference in New Issue
Block a user