WIP: Save current state - security subsystems, migrations, logging
This commit is contained in:
@@ -1,17 +1,26 @@
|
||||
# Stage 1: Build server binary
|
||||
FROM golang:1.23-alpine AS server-builder
|
||||
FROM golang:1.24-alpine AS server-builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install git for module resolution
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Copy go.mod and go.sum
|
||||
COPY aggregator-server/go.mod aggregator-server/go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY aggregator-server/ .
|
||||
COPY aggregator-server/ ./
|
||||
RUN CGO_ENABLED=0 go build -o redflag-server cmd/server/main.go
|
||||
|
||||
# Stage 2: Build agent binaries for all platforms
|
||||
FROM golang:1.23-alpine AS agent-builder
|
||||
FROM golang:1.24-alpine AS agent-builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Install git for module resolution
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Copy agent source code
|
||||
COPY aggregator-agent/ ./
|
||||
|
||||
@@ -30,7 +39,7 @@ RUN CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o binaries/windows-arm64/r
|
||||
# Stage 3: Final image with server and all agent binaries
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk --no-cache add ca-certificates tzdata
|
||||
RUN apk --no-cache add ca-certificates tzdata bash
|
||||
WORKDIR /app
|
||||
|
||||
# Copy server binary
|
||||
@@ -40,6 +49,11 @@ COPY --from=server-builder /app/internal/database ./internal/database
|
||||
# Copy all agent binaries
|
||||
COPY --from=agent-builder /build/binaries ./binaries
|
||||
|
||||
# Copy and setup entrypoint script
|
||||
COPY aggregator-server/docker-entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["./redflag-server"]
|
||||
Reference in New Issue
Block a user