Running an OpenDocMan Document Management System Inside a Docker Container
We are pleased to announce our first release of OpenDocMan on Docker, a containerized deployment for OpenDocMan that utilizes the fantastic Docker container system. With this new method of deployment you can eliminate all of the server set up and just get to running OpenDocMan inside Docker right away . As long as you can get a local Docker server up and running (very easy!) you can deploy our docker container to your server in seconds and have a fully functional OpenDocMan installation.
What Is Docker?
Docker is a system that provides “containerized” deployments of applications. If you want to know more about it you should visit this page: What Is Docker?
Why don’t I just install OpenDocMan the old way?
Getting an OpenDocMan server up and running from the source code can be straightforward for those with some experience with setting up web servers. Unfortunately, even experienced users can have issues with their server environment that prevent them from being able to use OpenDocMan. We also have plenty of potential users who would like to use OpenDocMan but do not have the resources to properly set up a web server. We want to help anyone in that situation. With this new containerized method of installation we completely eliminate the web server setup. If you can create a new Linux server in the cloud (or locally), you can run OpenDocMan inside Docker and have an open source document management system running in minutes (or seconds if your real snappy!).
Ok, I will give it a go, what next?
The first thing you need to do is make sure you have a running MySQL server with an OpenDocMan database created and a username/password to access it. This OpenDocMan Docker we are using for this tutorial is just the code and the web server. The database is not part of the container. You will then need to decide on where you want to install your Docker server. A Docker server runs on either Linux, or by using a tool called Boot2Docker for Mac which will emulate a Linux server on your Mac for testing/development purposes. The easiest way to get started is to utilize a cloud server company that can give you a Docker server with a click of a button. We have found Digital Ocean to be a good, inexpensive provider for turn-key Docker servers. Once you have your docker server running….
I have the Docker server up, lets do this!
Ok, the hard part is out of the way. There is a decision you need to make. You can:
1) Checkout our github repository containing our Docker build files and “build” an image to use
Or
2) Download our OpenDocMan image directly from our Docker hub repository
If you think you might be customizing the installation you will be better of running from the github repository. If you just want to get going quickly it would be best to start with our Docker Hub repository.
Running OpenDocMan from a Dockerfile
This method of building the OpenDocMan application from a build file will allow you to customize anything needed for your particular environment. To get your document management server going:
- Login to your docker server
- Make sure you have “git” installed on the server. If not, use either apt-get or yum to install it
- apt-get install git
- yum install git
- Now you will clone our OpenDocMan docker build repository
- git clone https://github.com/opendocman/docker-opendocman-minimal.git ./docker-opendocman-minimal
- Now lets build the image
- mkdir /var/odm_data
- cd docker-opendocman-minimal
- docker build –rm –tag=”docker-opendocman-minimal” . (don’t forget the dot)
- docker images
- We have an image now, we want to actually “run” it on our Docker server
- docker run -d -p 80:80 -v /var/odm_data:/var/www/odm_data docker-opendocman-minimal
- docker ps
- Now that its up and running you should be able to visit your servers IP in your browser and be present with the installation page
Running OpenDocMan from a Docker Hub Image
This way of running OpenDocMan Docker image will allow you to skip the build process entirely and just “run” the image in your Docker server
- Login to your docker server
- Run the OpenDocMan Docker image
- mkdir /var/odm_data
- docker run -d -p 80:80 -v /var/odm_data:/var/www/odm_data stephenlawrence/opendocman-www:minimal
- docker ps
- You can now visit your server IP and you will see the installation page
I think its running, what do I do now?
Well, you can login to the container and poke around, or you can visit your Docker servers’ IP address and you should see your OpenDocMan installer.
Whats next?
We are going to be putting together a MySQL container that will come pre-installed with a running OpenDocMan database, ready-to-use with your OpenDocMan application container. Stay Tuned!