3liz / lizmap-docker-compose

Run Lizmap stack with docker-compose
31 stars 42 forks source link

the "make configure" command generates two .env files #20

Closed MaxiReglisse closed 2 years ago

MaxiReglisse commented 2 years ago

I want the data to be in a dedicated folder: /docker instead of working directory. So i modified the Makefile as follows:

# INSTALL_DIR:=$(shell pwd)/lizmap
INSTALL_DIR:=/docker/lizmap

The two files are generated at the same time:

docker@lizmap-dev:~/lizmap-docker-compose $ ls -l .env
-rw-r--r-- 1 docker docker 413 17 déc.  16:30 .env
docker@lizmap-dev:~/lizmap-docker-compose $ ls -l /docker/lizmap/.env 
-rw-r--r-- 1 docker docker 359 17 déc.  16:30 /docker/lizmap/.env

But they have different contents:

docker@lizmap-dev:~/lizmap-docker-compose (mshe) $ cat .env
LIZMAP_PROJECTS=/home/docker/lizmap-docker-compose/lizmap/instances
LIZMAP_DIR=/home/docker/lizmap-docker-compose/lizmap
LIZMAP_UID=1001
LIZMAP_GID=1001
LIZMAP_VERSION_TAG=3.4
QGIS_VERSION_TAG=3.16
POSTGIS_VERSION=13-3
POSTGRES_PASSWORD=postgres
QGIS_MAP_WORKERS=1
WPS_NUM_WORKERS=1
LIZMAP_PORT=127.0.0.1:8090
OWS_PORT=127.0.0.1:8091
WPS_PORT=127.0.0.1:8092
POSTGIS_PORT=127.0.0.1:5432
POSTGIS_ALIAS=db.lizmap   

docker@lizmap-dev:~/lizmap-docker-compose (mshe) $ cat /docker/lizmap/.env 
LIZMAP_PROJECTS=/docker/lizmap/instances
LIZMAP_DIR=/docker/lizmap
LIZMAP_UID=1001
LIZMAP_GID=1001
LIZMAP_VERSION_TAG=3.4 
QGIS_VERSION_TAG=3.16
POSTGIS_VERSION=13-3
POSTGRES_PASSWORD=postgres
QGIS_MAP_WORKERS=1
WPS_NUM_WORKERS=1
LIZMAP_PORT=127.0.0.1:8090
OWS_PORT=127.0.0.1:8091
WPS_PORT=127.0.0.1:8092
POSTGIS_PORT=127.0.0.1:5432
POSTGIS_ALIAS=db.lizmap   

This situation is confusing ... What is the correct solution to configure the data location folder?

Thanks in advance,

MaxiReglisse.

nboisteault commented 2 years ago

@dmarteau Any idea?

dmarteau commented 2 years ago

It seems there is a bug here: https://github.com/3liz/lizmap-docker-compose/blob/master/Makefile#L26

dmarteau commented 2 years ago

Fixed invalid copy of .env file, replaced by symlink to INSTALL_DIR/.env: https://github.com/3liz/lizmap-docker-compose/commit/1c00aef6853d62662cb962553ada187128d3a35d

@MaxiReglisse: you don't need to edit the Makefile for overriding the install location: use make configure INSTALL_DIR=/my/location

MaxiReglisse commented 2 years ago

Thank you both, that fixed the problem!

MaxiReglisse