08-03-2020, 04:54 PM
Just checked your git repo and I think the problem is in:
docker-compose.yml
you set two env variables:
TACTIC_INSTALL_DIR: '/home/apache/tactic'
TACTIC_DATA_DIR: '/home/apache/tactic_data'
if you check /usr/local/lib/python3.7/site-packages/tacticenv/__init__.py they are used to setup the sys.path
they should point to the new installation deault:
TACTIC_INSTALL_DIR: '/opt/tactic/tactic'
TACTIC_DATA_DIR: '/opt/tactic/tactic_data'
Regarding the Docker Volumes, yes they are very handy to keep the status when you re-deploy docker images and very useful when upgrading, but...
If you launch the tactic installation in the dockerfile it will try to create the sthpw db inside the same image and fail.
You should install tactic without the db creation (--install_db false) but then you will have to write some code in the docker entry point to check if the DB exists and cerate it if it doesn't we should add an option in the install.py to just create the sthpw db.
Still both tactic and the install.py script use os.system() to launch some postgres utilities like createdb and psql to create new dbs for projects (see src/pyasm/search/database_impl.py) which will fail if the database is running on a different machine or docker image.
We should try to solve these problems in tactic first.
I started my docker image mainly as a quick debug tool to test changes in the tactic code in a clean environment to avoid the "works on my machine" problem, this is why I never developed e better/proper image, but I guess we could join forces with Remko to add a Dockerfile/docker-compose.yml directly into the tactic codebase, for them to become "official"
In my production environment I use a docker image for postgres but I prefer to run tactic in a python virtualenv.
docker-compose.yml
you set two env variables:
TACTIC_INSTALL_DIR: '/home/apache/tactic'
TACTIC_DATA_DIR: '/home/apache/tactic_data'
if you check /usr/local/lib/python3.7/site-packages/tacticenv/__init__.py they are used to setup the sys.path
they should point to the new installation deault:
TACTIC_INSTALL_DIR: '/opt/tactic/tactic'
TACTIC_DATA_DIR: '/opt/tactic/tactic_data'
Regarding the Docker Volumes, yes they are very handy to keep the status when you re-deploy docker images and very useful when upgrading, but...
If you launch the tactic installation in the dockerfile it will try to create the sthpw db inside the same image and fail.
You should install tactic without the db creation (--install_db false) but then you will have to write some code in the docker entry point to check if the DB exists and cerate it if it doesn't we should add an option in the install.py to just create the sthpw db.
Still both tactic and the install.py script use os.system() to launch some postgres utilities like createdb and psql to create new dbs for projects (see src/pyasm/search/database_impl.py) which will fail if the database is running on a different machine or docker image.
We should try to solve these problems in tactic first.
I started my docker image mainly as a quick debug tool to test changes in the tactic code in a clean environment to avoid the "works on my machine" problem, this is why I never developed e better/proper image, but I guess we could join forces with Remko to add a Dockerfile/docker-compose.yml directly into the tactic codebase, for them to become "official"
In my production environment I use a docker image for postgres but I prefer to run tactic in a python virtualenv.