2022-02-13 19:43:49 +03:00
|
|
|
FROM python:3.10.2-bullseye
|
2022-06-08 01:14:56 +03:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2022-02-06 21:43:17 +03:00
|
|
|
|
|
|
|
RUN mkdir -p /usr/src/robosats
|
|
|
|
|
2022-02-07 14:21:59 +03:00
|
|
|
# specifying the working dir inside the container
|
|
|
|
WORKDIR /usr/src/robosats
|
2022-02-06 21:43:17 +03:00
|
|
|
|
2022-06-08 01:14:56 +03:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y postgresql-client
|
|
|
|
|
2022-02-13 19:43:49 +03:00
|
|
|
RUN python -m pip install --upgrade pip
|
|
|
|
|
2022-02-06 21:43:17 +03:00
|
|
|
COPY requirements.txt ./
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
# copy current dir's content to container's WORKDIR root i.e. all the contents of the robosats app
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# fit lnd grpc services
|
|
|
|
RUN pip install grpcio grpcio-tools googleapis-common-protos
|
|
|
|
RUN cd api/lightning && git clone https://github.com/googleapis/googleapis.git
|
|
|
|
RUN cd api/lightning && curl -o lightning.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/lightning.proto
|
|
|
|
RUN cd api/lightning && python3 -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. lightning.proto
|
|
|
|
RUN cd api/lightning && curl -o invoices.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/invoicesrpc/invoices.proto
|
|
|
|
RUN cd api/lightning && python3 -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. invoices.proto
|
|
|
|
RUN cd api/lightning && curl -o router.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/routerrpc/router.proto
|
|
|
|
RUN cd api/lightning && python3 -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. router.proto
|
|
|
|
|
|
|
|
# patch generated files relative imports
|
|
|
|
RUN sed -i 's/^import .*_pb2 as/from . \0/' api/lightning/router_pb2.py
|
|
|
|
RUN sed -i 's/^import .*_pb2 as/from . \0/' api/lightning/invoices_pb2.py
|
|
|
|
RUN sed -i 's/^import .*_pb2 as/from . \0/' api/lightning/router_pb2_grpc.py
|
|
|
|
RUN sed -i 's/^import .*_pb2 as/from . \0/' api/lightning/lightning_pb2_grpc.py
|
|
|
|
RUN sed -i 's/^import .*_pb2 as/from . \0/' api/lightning/invoices_pb2_grpc.py
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
2022-02-13 19:43:49 +03:00
|
|
|
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
|