Skip to content

Commit

Permalink
Change location-grpc-service image base to cut down build time
Browse files Browse the repository at this point in the history
Here is the issue related to long grpcio build time  grpc/grpc#22815
  • Loading branch information
vincent6767 committed Oct 17, 2021
1 parent 907276d commit c2ab527
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 1 addition & 7 deletions modules/locationgrpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
FROM python:3.7-alpine
FROM vincentbiasa6767/python-grpc:latest

WORKDIR .

RUN apk add --no-cache g++ gcc musl-dev linux-headers geos libc-dev postgresql-dev
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install --no-cache-dir --force-reinstall -Iv grpcio==1.41.0
RUN pip install --no-cache-dir --force-reinstall -Iv grpcio-tools==1.41.0

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

Expand Down
13 changes: 13 additions & 0 deletions modules/locationgrpc/Dockerfile.pythongrpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Specifically created to cut down the build time due to this: https://github.com/grpc/grpc/issues/22815
FROM python:3.7-alpine

WORKDIR .

RUN apk add --no-cache g++ gcc musl-dev linux-headers geos libc-dev postgresql-dev

RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install --no-cache-dir --force-reinstall -Iv grpcio==1.41.0
RUN pip install --no-cache-dir --force-reinstall -Iv grpcio-tools==1.41.0

CMD ["python3"]
2 changes: 1 addition & 1 deletion modules/locationgrpc/location_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def Create(self, request, context):
}

topic_name = 'location'
kafka_server = 'kafka:9092'
kafka_server = 'kafka-service:9092'
producer = KafkaProducer(bootstrap_servers=kafka_server)

producer.send(topic_name, request_value)
Expand Down

0 comments on commit c2ab527

Please sign in to comment.