diff --git a/Dockerfile b/Dockerfile index 3847b06..5473e99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM tomcat:8.5 +FROM tomcat:8.5-jre8-alpine WORKDIR /app - -RUN apt-get update && apt-get install -y mc default-jdk +RUN apk update && apk upgrade && \ + apk add openjdk8 +#RUN apk update && apk install -y openjdk8 #RUN apt-get update && apt-get install -y default-jdk #COPY tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml @@ -15,13 +16,14 @@ RUN wget https://jdbc.postgresql.org/download/postgresql-9.4.1209.jre7.jar && \ # mv ODK-Aggregate-v2.0.3.war ${CATALINA_HOME}/webapps/ODK-Aggregate-v2.0.3.war #COPY ODK-Aggregate-v2.0.3.war ${CATALINA_HOME}/webapps/ODK-Aggregate-v2.0.3.war -COPY ODK-Aggregate-v2.0.3.war jdbc.properties ./ +COPY ODK-Aggregate-v2.0.3.war jdbc.properties security.properties ./ RUN pwd && mkdir odktemp && \ cd odktemp && \ ls -la /app && \ jar -xvf /app/ODK-Aggregate-v2.0.3.war && \ cp /app/jdbc.properties ./WEB-INF/classes/ && \ + cp /app/security.properties ./WEB-INF/classes/ && \ cd /app && \ mkdir ${CATALINA_HOME}/webapps/odk-aggregate && \ rm -fr ${CATALINA_HOME}/webapps/ROOT/* && \ diff --git a/README.md b/README.md index 7da63b8..15fe7df 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,23 @@ Run: - apt-get install -y git - git clone https://github.com/roissard/odk.git - cd odk - bash ./install.sh - bash ./prepare.sh - systemctl start odk +``` bash +apt-get install -y git +git clone https://github.com/CartONG/odk.git +cd odk +bash ./install.sh +bash ./prepare.sh +systemctl start odk +``` + +If setup is to be done on a production domain, update the conf, in the `security.properties` file to follow your need: +``` yml +... +security.server.hostname=aggregate.domain.org +security.server.port=80 +security.server.securePort=443 +... +``` Open: diff --git a/docker-compose.yaml b/docker-compose.yaml index dfd70da..f7f0f9a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,15 +5,13 @@ services: dockerfile: Dockerfile context: . ports: - - 80:8080 -# For debugging -# - 7081:8080 + - 8000:8080 volumes: - .:/app depends_on: - postgres postgres: - image: postgres:latest + image: postgres:10 volumes: - db_data:/var/lib/postgresql/data environment: diff --git a/install.sh b/install.sh index 28ae3c5..70e38b8 100644 --- a/install.sh +++ b/install.sh @@ -2,8 +2,7 @@ curl -sSL https://get.docker.com | sh -apt-get install -y python python-pip libffi-dev -pip install docker-compose +apt-get install -y python libffi-dev libssl-dev docker-compose cp odk.service /etc/systemd/system/ systemctl enable odk diff --git a/odk.service b/odk.service index e6f8428..f0dabde 100644 --- a/odk.service +++ b/odk.service @@ -6,9 +6,9 @@ After=docker.service [Service] Type=oneshot RemainAfterExit=yes -WorkingDirectory=/home/pi/odk -ExecStart=/usr/local/bin/docker-compose up -d -ExecStop=/usr/local/bin/docker-compose down +WorkingDirectory=/home/debian/odk +ExecStart=/usr/bin/docker-compose up -d +ExecStop=/usr/bin/docker-compose down TimeoutStartSec=0 [Install] diff --git a/security.properties b/security.properties new file mode 100644 index 0000000..ed5c039 --- /dev/null +++ b/security.properties @@ -0,0 +1,11 @@ +security.server.deviceAuthentication=digest +security.server.secureChannelType=REQUIRES_INSECURE_CHANNEL +security.server.channelType=REQUIRES_INSECURE_CHANNEL +security.server.forceHttpsLinks=false +security.server.hostname=aggregate.cartong.org +security.server.port=8000 +security.server.securePort=443 +security.server.superUserUsername=administrator +security.server.realm.realmString=ODK Aggregate +security.server.checkHostnames=true +