30 lines
606 B
Docker
30 lines
606 B
Docker
FROM python:3.11-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./requirements.txt .
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
curl \
|
|
protobuf-compiler \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY ./protos ./protos
|
|
COPY ./src ./src
|
|
|
|
RUN python -m grpc_tools.protoc \
|
|
--proto_path=./protos \
|
|
--python_out=./src \
|
|
--grpc_python_out=./src \
|
|
./protos/brunix.proto
|
|
|
|
EXPOSE 50051
|
|
|
|
CMD ["python", "src/server.py"] |