-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcloudrun.Dockerfile
More file actions
43 lines (29 loc) · 847 Bytes
/
cloudrun.Dockerfile
File metadata and controls
43 lines (29 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Build stage
FROM golang:1.26-alpine AS builder
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o voiceflow-cli .
# Final stage
FROM alpine:latest
# Install ca-certificates for HTTPS requests
RUN apk --no-cache add ca-certificates tzdata
# Create a non-root user
RUN adduser -D -s /bin/sh voiceflow
WORKDIR /app
# Copy the binary from builder stage and set proper ownership
COPY --from=builder --chown=voiceflow:voiceflow /app/voiceflow-cli .
# Make sure the binary is executable
RUN chmod +x voiceflow-cli
USER voiceflow
# Expose port for the server
EXPOSE 8080
# Set environment variables
ENV PORT=8080
ENV GIN_MODE=release
# Run the binary
CMD ["/app/voiceflow-cli", "server", "--port", "8080"]