update docker

This commit is contained in:
Florian Bezannier
2022-03-31 01:08:32 +02:00
parent 128873656f
commit 8d5c0cac9a
3 changed files with 16 additions and 11 deletions
+12 -7
View File
@@ -3,22 +3,27 @@ ARG DEBIAN_FRONTEND=noninteractive
FROM debian:bullseye-slim AS builder
ARG PYTHON_DEP
RUN BUILD_DEP='python3-pip python3-setuptools python3-dev libblas-dev liblapack-dev gfortran libatlas3-base' ; \
RUN BUILD_DEP='python3-pip python3-setuptools python3-dev libblas-dev liblapack-dev gfortran' ; \
apt-get update && apt-get install -y --no-install-recommends $BUILD_DEP $PYTHON_DEP;
COPY psa-car-controller /psa-car-controller
COPY requirements.txt /tmp/
RUN pip3 install --system --no-cache-dir --ignore-installed -r /tmp/requirements.txt
RUN pip3 install --upgrade pip
RUN pip3 install poetry
COPY poetry.lock pyproject.toml ./
RUN poetry export -f requirements.txt --output /tmp/requirements.txt
RUN pip3 install --no-deps --no-cache-dir --ignore-installed -r /tmp/requirements.txt
RUN poetry install
EXPOSE 5000
FROM debian:bullseye-slim
ARG PYTHON_DEP
WORKDIR /config
ENV PSACC_BASE_PATH=/ PSACC_PORT=5000 PSACC_OPTIONS="-c -r --web-conf" PSACC_CONFIG_DIR="/config"
ENV PSACC_BASE_PATH=/ PSACC_PORT=5000 PSACC_OPTIONS="-c -r --web-conf" PSACC_CONFIG_DIR="/config" PYTHONPATH="/app"
COPY --from=builder /var/lib/apt /var/lib/apt
COPY --from=builder /var/cache/apt/ /var/cache/apt/
COPY --from=builder /usr/local/lib /usr/local/lib
RUN apt-get install -y --no-install-recommends $PYTHON_DEP && \
apt-get clean ; \
rm -rf /var/lib/apt/lists/*
COPY . /psa-car-controller/
CMD /psa-car-controller/docker_files/init.sh
RUN mkdir app
COPY psa_car_controller /app/psa_car_controller
COPY /docker_files/init.sh /init.sh
CMD /init.sh
+1 -1
View File
@@ -2,4 +2,4 @@
echo "Containerised psa_car_controller loading..."
cd "$PSACC_CONFIG_DIR"
ARGS="-p $PSACC_PORT -l 0.0.0.0 -b $PSACC_BASE_PATH $PSACC_OPTIONS"
python3 -u /psa_car_controller $ARGS
python3 -u -m psa_car_controller $ARGS
+3 -3
View File
@@ -4,7 +4,7 @@
1.2 Install requirements :
- You need **python >= 3.6**
- You need **python >= 3.7**
- On debian based distribution you can install some requirement from repos, it's faster than installtion with pip:
@@ -20,10 +20,10 @@
Start the app with charge control enabled :
``python3 psa-car-controller --web-conf``
``python3 -m psa-car-controller --web-conf``
At the first launch you will be asked to connect and give a code that you will receive by SMS and also give your pin code (the four-digit code that your use on the android app).
If it failed you can remove the file otp.bin and retry.
You can see all options available with :
``python3 psa-car-controller -h``
``python3 -m psa-car-controller -h``