Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/* && \
Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions odk.service
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 11 additions & 0 deletions security.properties
Original file line number Diff line number Diff line change
@@ -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