diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3f84b47 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "api/scripts"] + path = api/scripts + url = https://github.com/openbikesensor/OpenBikeSensor-Scripts diff --git a/api/Dockerfile b/api/Dockerfile index b074128..9972a3a 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,9 +1,18 @@ -FROM node:14 +FROM node:15.11.0-buster + +# Install python3, pip3, and make them the default for `python` and `pip` commands +RUN apt-get update && apt-get install -y python3 python3-pip +RUN ln -s $(which python3) /usr/local/bin/python +RUN ln -s $(which pip3) /usr/local/bin/pip WORKDIR /opt/obs/api + ADD package.json package-lock.json /opt/obs/api/ RUN npm ci +ADD scripts/setup.py scripts/requirements.txt /opt/obs/api/scripts/ +RUN cd scripts && pip install -e . + ADD views /opt/obs/api/views/ ADD src /opt/obs/api/src/ diff --git a/api/scripts b/api/scripts new file mode 160000 index 0000000..1f340a8 --- /dev/null +++ b/api/scripts @@ -0,0 +1 @@ +Subproject commit 1f340a835c327f6410b1954a9824a9d4a5b7d9b0 diff --git a/docker-compose.yaml b/docker-compose.yaml index 267b10e..9b13122 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,6 +16,7 @@ services: context: ./api volumes: - ./api/src:/opt/obs/api/src + - ./api/scripts:/opt/obs/api/scripts - ./api/views:/opt/obs/api/views - ./local/api-data:/data - ./api/.migrations.js:/opt/obs/api/.migrations.js