From 3d684f1d19b5ccece0b9b2d8dcf22b9ead035da0 Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Tue, 22 Dec 2020 13:19:11 +0100 Subject: [PATCH] The Dockerfile now works as expected --- Dockerfile | 6 ++++-- docs/index.md | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 90e5ca94..337dc087 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ # Since we are including resources from the parent folder, # this Dockerfile has to be executed from the project's parent folder, like this: -# sudo docker build --tag vips/logic:TEST01 -f VIPSLocic/Dockerfile . +# sudo docker build --tag vips/logic:TEST01 -f VIPSLogic/Dockerfile . + +## Challenge: database connection to "localhost" ?? IP address? What?? :-) # the first stage of our build will use a maven 3.6 parent image FROM maven:3.6-openjdk-11 AS MAVEN_BUILD @@ -51,7 +53,7 @@ RUN echo '<?xml version="1.0" encoding="UTF-8"?>\ <module xmlns="urn:jboss:module:1.0" name="org.postgresql">\ <resources>\ <resource-root path="postgresql-42.2.18.jar"/>\ - <resource-root path="postgis-jdbc-2.1.0.jar"/>\ + <resource-root path="postgis-jdbc-2.2.2.jar"/>\ </resources>\ <dependencies>\ <module name="javax.api"/>\ diff --git a/docs/index.md b/docs/index.md index 897ba214..b7700294 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,39 @@ # Building VIPSLogic +## But first: A deployment note +Whether you deploy using Docker or Wildfly (or another JEE server), the context path of the app is always /VIPSLogic. However, the app is designed to be accessible at the root level. So you always need to proxy it behind e.g. Apache or Nginx. Here's an example vhost for Apache: + +``` +<VirtualHost *:80> + ServerName vipslogic-local.no + + AddDefaultCharset UTF-8 + + ProxyPass / http://localhost:18080/VIPSLogic/ + ProxyPassReverse / http://localhost:18080/VIPSLogic/ + ProxyPassReverseCookiePath /VIPSLogic / +</VirtualHost> + +``` ## Docker -### Contents of standalone.xml +### Building +You need the +Make sure you're located in the parent folder of the VIPSLogic project. You need these resource files/folders in your current folder: +* standalone.xml (see below) +* VIPSCommon/ (can be cloned [from here](https://gitlab.nibio.no/VIPS/VIPSCommon)) + +Run + +`sudo docker build --tag vips/logic:TEST01 -f VIPSLogic/Dockerfile .` + +#### Contents of standalone.xml VIPSLogic is using system properties for instance specific settings. In Wildfly (JBoss), these can be provided -in the standalone.xml file. Examples for this is available in the `wildfly_config_examples/` folder. \ No newline at end of file +in the standalone.xml file. Examples for this is available in the `wildfly_config_examples/` folder. + +### Running + +`sudo docker run --publish 18080:8080 --add-host=vipslogicdb:[YOUR_HOSTS_IP_ADDRESS] --detach --name vipslogic vips/logic:TEST01` + +### Troubleshooting by logging in +`sudo docker exec -it <containername> bash` + -- GitLab