-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.tesla-http-proxy
32 lines (23 loc) · 1.12 KB
/
Dockerfile.tesla-http-proxy
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
# Define the Git hash as a build argument
ARG GIT_HASH=d472dfc0cc15ef2b8976b4e447d9c6262d46e320
# Build stage
FROM golang:1.23 AS builder
# Set the working directory inside the container
WORKDIR /app
# Clone the repository, check out the specific commit, and build the binary
RUN git clone https://github.com/teslamotors/vehicle-command.git && \
cd /app/vehicle-command/cmd/tesla-http-proxy && \
git checkout ${GIT_HASH} && \
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o /app/tesla-http-proxy
# Run stage
FROM gcr.io/distroless/static-debian12 AS runner
# Set the working directory inside the container
WORKDIR /app
# Copy the self-signed certificate into the container
COPY certs /app/certs
# Copy the built binary and certificates (if present) from the builder stage
COPY --from=builder /app/tesla-http-proxy /app/tesla-http-proxy
# Expose the port for the application
EXPOSE 4443
# Run the application
CMD ["/app/tesla-http-proxy", "-tls-key", "/app/certs/tls-key.pem", "-cert", "/app/certs/tls-cert.pem", "-port", "4443", "-key-file", "/app/certs/private-key.pem", "-host", "0.0.0.0", "-verbose"]