As Tryton has own image in Docker, however, it do not have the Volume Mount to the modules.
It will be good to have it, because it might help the developer to use the docker for testing module when any update.
Another thing, any plan to post the Official DockerFile to github?
@nicoe@pokoli yes, my mean is Dockerfiles to Github so that it can link to Docker Hub.
I had tried to custom the Dockerfile to have mount to “modules” folder. However, when mounting, the content inside the docker will be erased.
I remember old time has suggestion to custom module path at the config file - just like “addons path” in odoo. But it been rejected by @ced .
I do not know whether should I open this issue up again. Because, if able to custom the “Module” path. It will really very helpful for maintenance for custom module.
You do not need to have the Tryton Dockerfile on github for that because you should not create a new image from scratch to add your modules but you should extend the published image tryton/tryton:5.0.
Here is an example of Dockerfile we use for custom project (one repository with all the custom code):
FROM tryton/tryton:5.0 as builder
USER root
RUN mkdir /module
COPY . /module
WORKDIR /module
RUN python3 setup.py sdist
FROM tryton/tryton:5.0
USER root
COPY --from=builder /module/dist /dist
RUN pip3 install /dist/* \
&& rm -rf /root/.cache
USER trytond
The file is stored at the top of the repository and you just run docker build ..
It will still be rejected because installing a module should be done with setuptools in order to check the dependencies.
This is just a dummy folder to store temporary the module package that will be installed. At run time this folder does nothing. This idea of just dropping code in a folder is plain wrong, installation requires some checks and processing like: dependency, 2to3 conversion, compilation etc.
I think the question is how to setup a development environment which I interpret as having a fast loop of updating and running the changes and not necessarily check dependencies, etc. IMO it is not viable to build a new image just to test each change, that is too slow.
There is no point to use Docker to develop. Developers must setup a development environment (virtualenv, pip, VCS etc.) which provides the fastest development loop.
Docker is for deployment.
That is highly opinionated I believe. I tend to use Docker for development mostly and find it convenient to have all environment (including system packages, file system, etc.) separated.
agree with @ced for developer should setup local env. However, sometime we only need to do some testing for some quick reference. In that case, docker will really help to short the setup time.
I have also tried using docker for development as many people have been talking about it in blogs and such but it was too slow. The fastest has been on a virtualenv.