-
Notifications
You must be signed in to change notification settings - Fork 533
/
Copy pathcodegen.Dockerfile
44 lines (31 loc) · 1.29 KB
/
codegen.Dockerfile
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
44
FROM golang:1.23
# Install Golang deps
RUN go install github.com/bufbuild/buf/cmd/[email protected] && \
go install google.golang.org/protobuf/cmd/[email protected] && \
go install connectrpc.com/connect/cmd/[email protected]
# Install our custom protoc plugin, connect-python
COPY ./packages/connect-python /packages/connect-python
RUN cd /packages/connect-python && make bin/protoc-gen-connect-python
FROM python:3.9
# Set working directory
WORKDIR /workspace
ENV PROTOC_ZIP=protoc-29.3-linux-aarch_64.zip
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v29.3/$PROTOC_ZIP
RUN unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
# Copy installed Go deps from previous build step
COPY --from=0 /go /go
# Add Go binary to PATH
ENV PATH="/go/bin:${PATH}"
# Install Python deps
RUN pip install black==23.7.0 pyyaml==6.0.2 openapi-python-client==0.24.3
# Install Node.js and npm
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Node.js deps
RUN npm install -g pnpm @connectrpc/[email protected] @bufbuild/[email protected]
# Generate when container starts
CMD ["make", "generate"]