Made a blog post with the full set of steps to use a MySQL container with the Mayan container: http://www.mayan-edms.org/post/deploy-mayan-docker-mysql/
In summary you are configuring the Mayan container but are not launching a separate MySQL container. I tried to explain as much as possible in the post starting with some Docker basics. Hope you enjoy it and helps you. On Wednesday, July 26, 2017 at 11:51:24 AM UTC-4, Mark Phillips wrote: > > Regarding environment variables, I tried to install mayan 2.6.1 two ways, > and cannot get it to work. I am trying to use docker to create mayan 2.6.1 > with mysql as per the instructions - > https://gitlab.com/mayan-edms/mayan-edms-docker/tree/2.6.1. > > 1. I created a root shell (Ubuntu 14.01) and created the following shell > environment variables using the following script - > > #!/bin/sh > MAYAN_DATABASE_DRIVER=\'django.db.backends.mysql\' > MAYAN_DATABASE_NAME=\'memorabilia\' > MAYAN_DATABASE_USER=\'mayan\' > MAYAN_DATABASE_PASSWORD=\'ooTh7ietieT0aKea\' > MAYAN_DATABASE_HOST=\'localhost\' > MAYAN_DATABASE_PORT=\'3306\' > export MAYAN_DATABASE_DRIVER > export MAYAN_DATABASE_NAME > export MAYAN_DATABASE_USER > export MAYAN_DATABASE_PASSWORD > export MAYAN_DATABASE_HOST > export MAYAN_DATABASE_PORT > echo $MAYAN_DATABASE_DRIVER > echo $MAYAN_DATABASE_NAME > echo $MAYAN_DATABASE_USER > echo $MAYAN_DATABASE_PASSWORD > echo $MAYAN_DATABASE_HOST > echo $MAYAN_DATABASE_PORT > > The mayan instructions seem to indicate that the shell environment > variables need to single quotes around them. Is this correct, or are then > unquoted values? It the single quotes are not needed, I did not get an > error message about this. > > I then followed the instruction referenced above to pull mayan 2.6.1 and > then run mayan 2.6.1. I was able to access mayan from http://localhost, > but after looking into the settings.py file for this container, I found > that it was using sqlite and not mysql as the db backend. > > 2. I removed the above container and image and started again. I pulled > mayan 2.6.1, and created an env.list file as shown in the docker > instructions for passing environemnt variables to docker: > > MAYAN_DATABASE_DRIVER=django.db.backends.mysql > MAYAN_DATABASE_NAME=memorabilia > MAYAN_DATABASE_USER=mayan > MAYAN_DATABASE_PASSWORD=ooTh7ietieT0aKea > MAYAN_DATABASE_HOST=localhost > MAYAN_DATABASE_PORT=3306 > > I then ran mayan 2.6.1 with this command, passing the environment > variables as shown in the docker user guide > > docker run -d --name mayan-edms --restart=always -p 9005:80 --env-file > ./env.list -v mayan_data:/var/lib/mayan mayanedms/mayanedms:2.6.1 > > The container never started, or more specifically, it would start and stop > continuously. I removed the container and image as it was broken. > > How do I create a mayan 2.6.1 instance using docker and using mysql as the > backend database? It does not appear the environment variables are working > Or I don't understand how to use them!), although the terminology is rather > confusing. Are they docker environment variables (as in #2 above), or > environment variables from the shell where docker is run (as in #1 above)? > > Thanks! > > Mark > > On Mon, Jul 24, 2017 at 8:27 PM, Roberto Rosario > <[email protected]> wrote: > >> Yes, it is a less involved process and all dependencies are taken care of. >> >> 1. Correct, there is no need to use Python's virtualenv since the Docker >> container itself is already isolated from the OS. >> 2. Environment variables are only needed when the container is first >> created, afterwards it can be stopped and restarted and their values will >> persist internally in the container. >> >> On Wednesday, July 19, 2017 at 1:31:26 PM UTC-4, Mark Phillips wrote: >>> >>> I read the Docker install instructions for Mayan 2.6. Seems easy, but I >>> have a couple of questions - >>> >>> 1. After reading some about Docker, as I understand it, we don't need to >>> create a virtualenv for the Docker image. Is that correct? If not, I am not >>> sure how to combine the docker image with a virtualenv. >>> >>> 2. I see the environment variables make it easier to install with a >>> non-SQLite backend. Are these environment variables only for the install >>> process, or do then need to be a permanent feature? In other words, do I >>> set the environment variables in the current shell, or do they need to go >>> in my .profile so every time I log in they are present? >>> >>> Thanks! >>> >>> Mark >>> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "Mayan EDMS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "Mayan EDMS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
