Skip to content
Snippets Groups Projects
Verified Commit 3dd831db authored by David Beniamine's avatar David Beniamine
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
RESTART=no
DEV_PORT=8080
DB_PASSWORD=insert-random-string-here
.env
*.war
.*.sw?
FROM tomcat:8.5.54-jdk11-openjdk
WORKDIR /opt
ARG AGG_VERS=2.0.5
ARG CATALINA_HOME=/usr/local/tomcat
WORKDIR /opt
RUN wget -O aggregate.zip https://github.com/getodk/aggregate/releases/download/v${AGG_VERS}/ODK-Aggregate-v${AGG_VERS}-Linux-x64.run.zip
RUN unzip aggregate.zip
RUN rm aggregate.zip
COPY run.sh /opt
RUN chmod +x /opt/run.sh
RUN echo "Please run /opt/run.sh to configure aggregate"
WORKDIR $CATALINA_HOME
# ODK Docker-compose
This is a docker-compose setup for [ODK](https://getodk.org)
## Install
1. Adapt config `cp .env.sample .env` and edit `.env` in particular the DB password
2. Build and start : `docker-compose up --build -d` (this step may take a while)
3. Build the `.war file` : `docker-compose exec front /opt/run.sh` and answer questions (defaults are set according to .env
4. Get the sql ` docker-compose exec front ls /usr/local/tomcat/webapps/ODK\ Aggregate/create_db_and_user.sql` (you might have to adjust this path
5. Run `docker-compose exec db psql -U aggregate` and paste SQL from step 4
6. Restart the docker-compose `docker-compose down; docker-compose up -d`
At this point everything should be configured, go to `localhost:8080` and finish installation process.
Default password is `aggregate`, username is the one you set in step 2.
version: '2'
services:
front:
build:
context: .
args:
AGG_VERS:
CATALINA_HOME:
volumes:
- "webapps:${CATALINA_HOME}/webapps"
environment:
restart: ${RESTART}
CATALINA_HOME:
AGG_VERS:
DB_HOST:
HOST_NAME:
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "${DEV_PORT}:8080"
restart: ${RESTART}
db:
image: postgres
restart: ${RESTART}
environment:
POSTGRES_PASSWORD:
POSTGRES_USER:
POSTGRES_DB:
volumes:
- "db_data:/var/lib/postgresql/data"
volumes:
db_data:
webapps:
run.sh 0 → 100644
#!/bin/bash
/opt/ODK-Aggregate-v${AGG_VERS}-Linux-x64.run \
--parent_installdir $CATALINA_HOME/webapps \
--hostname $HOST_NAME \
--database_hostname $DB_HOST \
--jdbc_username $DB_USER \
--jdbc_password $DB_PASSWORD
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment