Docker image for marxan-server application
70
This is a standalone Docker image intended to be used with a standalone marxan-client image and a local database, though the database can be changed by updating the relevant env/dat files.
The Dockerfile contained uses the ubuntu linux system.
The instructions update the base image, a clean ubuntu image, and then install the requirements for the application, first the base system packages, then the software packages used by the application.
It the copies over the relevant application code into the image, exposes port 80 and runs the app.
To build the image go into the marxan-server/ folder and run:
docker build -t repo_name:image_name .
This instruction builds an image using the tag option (-t). This gives the image a name in the format repo_name:image_name. If you dont provide an image_name it will default to latest
The final part of the command is the path to the directory we want to build from. Given we are in the directory we want to build from we use .
example:
docker build -t openmarxserver:test .
Docker build options can be found here: https://docs.docker.com/engine/reference/commandline/build/
The command for running the docker container is:
docker run -dp 80:80 --name oms --network='host' openmarxserver:test
This runs the docker container.
-d is detatched mode, so you can use your terminal afterwards-p is the port command. In this instance we are using PORT 80 on our local machine and matching that to PORT 80 in the docker image. The Dockerfile exposes port 80 so thats the port our container is expecting to run on. If you wanted the image to run on PORT 5000 locally you would pass -p 5000:80.-d and -p together into -dp--name gives the container a name of your choice to make interacting with the container easier.--network='host' For standalone containers, remove network isolation between the container and the Docker host, and use the host’s networking directly. This allows connection to your local database, hosted on your machine. Network options can be found here: https://docs.docker.com/network/See above for linux but replace the --network='host' option with --add-host=database:<host-ip>
docker run -dp 80:80 --name oms --add-host=database:<host-ip> openmarxserver:test
see
The local database needs to be set up to run with the Docker images.
Postgres-10 needs to be installed, along with PostGIS 2.5 as per your system install instructions.
create your database and the extensions postgis and postgis_topology.
create a user jrc with password thargal88 in group postgres
Get the database restore file
wget https://github.com/marxanweb/marxan-server/releases/download/v1.0.0/dump.sql
restore the database.
If youre using pgadmin use pgadmin3 as pgadmin4 will not restore with OIDS
Content type
Image
Digest
Size
325 MB
Last updated
about 6 years ago
docker pull craicerjack/marxan-server:beta