Skip to content

Commit 17fee3d

Browse files
committed
Merge branch 'fix-docker' into 'master'
fix: docker See merge request 3d/cars-park/cars!835
2 parents 5cf34e7 + 4f96b99 commit 17fee3d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# exclude venv
2+
venv

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ COPY . /app/cars
3232

3333
# Install fiona and rasterio with gdal / proj from otb
3434
WORKDIR /app/cars
35-
RUN echo "CARS installation" && CARS_VENV=$VIRTUAL_ENV make clean && CARS_VENV=$VIRTUAL_ENV make install-gdal-dev
35+
RUN echo "CARS installation" && CARS_VENV=$VIRTUAL_ENV make clean && CARS_VENV=$VIRTUAL_ENV make install/dev-gdal
3636
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3737

3838
# hadolint ignore=DL3013,SC2102

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ install/deps-gdal: install/deps ## create an healthy python environment for GDAL
6363
@[ "${CHECK_FIONA}" ] ||${CARS_VENV}/bin/python -m pip install --no-binary fiona fiona
6464
@[ "${CHECK_RASTERIO}" ] ||${CARS_VENV}/bin/python -m pip install --no-binary rasterio rasterio
6565

66+
.PHONY: install/dev-gdal
67+
install/dev-gdal: install/deps-gdal ## install cars on healthy python env for gdal/proj
68+
@test -f ${CARS_VENV}/bin/cars || source ${CARS_VENV}/bin/activate; pip install --no-build-isolation --editable .[dev,docs,notebook]
69+
@test -f .git/hooks/pre-commit || echo " Install pre-commit hook"
70+
@test -f .git/hooks/pre-commit || ${CARS_VENV}/bin/pre-commit install -t pre-commit
71+
@test -f .git/hooks/pre-push || ${CARS_VENV}/bin/pre-commit install -t pre-push
72+
@echo "CARS ${CARS_VERSION} installed in dev mode in virtualenv ${CARS_VENV}"
73+
@echo "CARS venv usage: source ${CARS_VENV}/bin/activate; cars -h"
74+
6675
.PHONY: install/deps
6776
install: install/deps ## install cars in dev editable mode (pip install --no-build-isolation -e .) without recompiling rasterio and fiona
6877
@test -f ${CARS_VENV}/bin/cars || source ${CARS_VENV}/bin/activate; pip install --no-build-isolation --editable .[dev,docs,notebook]

0 commit comments

Comments
 (0)