Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: obiba/docker-agate
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.0.2-2
Choose a base ref
...
head repository: obiba/docker-agate
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 17 commits
  • 6 files changed
  • 1 contributor

Commits on Jun 2, 2024

  1. agate 3.0.3

    ymarcon committed Jun 2, 2024
    Copy the full SHA
    ddffbec View commit details

Commits on Jun 7, 2024

  1. agate 3.0.4

    ymarcon committed Jun 7, 2024
    Copy the full SHA
    0b40f65 View commit details

Commits on Jun 28, 2024

  1. agate 3.0.5

    ymarcon committed Jun 28, 2024
    Copy the full SHA
    9bf1907 View commit details

Commits on Oct 11, 2024

  1. agate 3.1.0

    ymarcon authored Oct 11, 2024
    Copy the full SHA
    ee1d2f5 View commit details
  2. jammy

    ymarcon committed Oct 11, 2024
    Copy the full SHA
    8700511 View commit details

Commits on Nov 8, 2024

  1. Copy the full SHA
    6a0f886 View commit details

Commits on Dec 8, 2024

  1. pre release 3.2.0-RC1

    ymarcon committed Dec 8, 2024
    Copy the full SHA
    33ccf20 View commit details
  2. fix: use application-prod

    ymarcon committed Dec 8, 2024
    Copy the full SHA
    55d7c97 View commit details
  3. re-added migration from 2.x

    ymarcon committed Dec 8, 2024
    Copy the full SHA
    125b939 View commit details

Commits on Dec 12, 2024

  1. agate 3.2.0

    ymarcon committed Dec 12, 2024
    Copy the full SHA
    fa49d48 View commit details

Commits on Dec 15, 2024

  1. Copy the full SHA
    029e0b4 View commit details
  2. chore: code clean up

    ymarcon committed Dec 15, 2024
    Copy the full SHA
    ce678d4 View commit details

Commits on Dec 22, 2024

  1. chore: apt clean up

    ymarcon committed Dec 22, 2024
    Copy the full SHA
    d7c2b68 View commit details
  2. fix: curl still needed

    ymarcon committed Dec 22, 2024
    Copy the full SHA
    f979ca5 View commit details

Commits on Jan 27, 2025

  1. agate 3.3.0

    ymarcon committed Jan 27, 2025
    Copy the full SHA
    cf6727f View commit details

Commits on Feb 8, 2025

  1. removed curl dependency

    ymarcon committed Feb 8, 2025
    Copy the full SHA
    115a0e0 View commit details

Commits on Feb 28, 2025

  1. agate 3.4.0

    ymarcon authored Feb 28, 2025
    Copy the full SHA
    1cd4acb View commit details
Showing with 43 additions and 52 deletions.
  1. +16 −11 Dockerfile
  2. +3 −9 Makefile
  3. +7 −7 bin/first_run.sh
  4. +13 −21 bin/start.sh
  5. +3 −2 docker-compose.yml
  6. +1 −2 docker-entrypoint.sh
27 changes: 16 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -4,9 +4,7 @@
# https://github.com/obiba/docker-agate
#

FROM tianon/gosu:latest AS gosu

FROM docker.io/library/eclipse-temurin:21-jre AS server-released
FROM docker.io/library/eclipse-temurin:21-jre-noble AS server-released

LABEL OBiBa <dev@obiba.org>

@@ -18,15 +16,17 @@ ENV AGATE_ADMINISTRATOR_PASSWORD=password
ENV AGATE_HOME=/srv
ENV JAVA_OPTS=-Xmx2G

ENV AGATE_VERSION 3.0.2
ENV AGATE_VERSION 3.4.0

# Install Agate Python Client
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https unzip curl python3-pip libcurl4-openssl-dev libssl-dev
DEBIAN_FRONTEND=noninteractive apt-get install -y gosu apt-transport-https unzip curl python3-pip libcurl4-openssl-dev libssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN pip install obiba-agate
RUN pip install --break-system-packages obiba-agate

# Install Agate Server
RUN set -x && \
@@ -36,15 +36,20 @@ RUN set -x && \
rm agate.zip && \
mv agate-${AGATE_VERSION} agate

COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/

RUN chmod +x /usr/share/agate/bin/agate

COPY ./bin /opt/agate/bin

RUN chmod +x -R /opt/agate/bin
RUN adduser --system --home $AGATE_HOME --no-create-home --disabled-password agate
RUN chown -R agate /opt/agate
RUN groupadd --system --gid 10041 agate && \
useradd --system --home $AGATE_HOME --no-create-home --uid 10041 --gid agate agate; \
chmod +x -R /opt/agate/bin && \
chown -R agate /opt/agate

# Clean up
RUN apt remove -y unzip wget curl && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/* /tmp/*

VOLUME /srv

12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -2,17 +2,11 @@
# Docker helper
#

no_cache=false

all:
sudo docker build --no-cache=true -t="obiba/agate:$(tag)" . && \
sudo docker build -t="obiba/agate:latest" . && \
sudo docker image push obiba/agate:$(tag) && \
sudo docker image push obiba/agate:latest
no_cache=true

# Build Docker image
build:
sudo docker build --no-cache=$(no_cache) -t="obiba/agate:$(tag)" .
docker build --pull --no-cache=$(no_cache) -t="obiba/agate:$(tag)" .

push:
sudo docker image push obiba/agate:$(tag)
docker image push obiba/agate:$(tag)
14 changes: 7 additions & 7 deletions bin/first_run.sh
Original file line number Diff line number Diff line change
@@ -18,8 +18,8 @@ cat $AGATE_HOME/conf/shiro.ini | sed -e "s,^administrator\s*=.*\,,administrator=
# Configure MongoDB
if [ -n "$MONGODB_URI" ]
then
sed s,localhost:27017/agate,$MONGODB_URI,g $AGATE_HOME/conf/application.yml > /tmp/application.yml
mv -f /tmp/application.yml $AGATE_HOME/conf/application.yml
sed s,localhost:27017/agate,$MONGODB_URI,g $AGATE_HOME/conf/application-prod.yml > /tmp/application-prod.yml
mv -f /tmp/application-prod.yml $AGATE_HOME/conf/application-prod.yml
elif [ -n "$MONGO_HOST" ]
then
MGP=27017
@@ -39,14 +39,14 @@ elif [ -n "$MONGO_HOST" ]
else
MGURI="$MGURI/$MGDB"
fi
sed s,localhost:27017/agate,$MGURI,g $AGATE_HOME/conf/application.yml > /tmp/application.yml
mv -f /tmp/application.yml $AGATE_HOME/conf/application.yml
sed s,localhost:27017/agate,$MGURI,g $AGATE_HOME/conf/application-prod.yml > /tmp/application-prod.yml
mv -f /tmp/application-prod.yml $AGATE_HOME/conf/application-prod.yml
fi

# Configure ReCaptcha
if [ -n "$RECAPTCHA_SITE_KEY" -a -n "$RECAPTCHA_SECRET_KEY" ]
then
sed s/secret:\ 6Lfo7gYT.*/secret:\ $RECAPTCHA_SECRET_KEY/ $AGATE_HOME/conf/application.yml | \
sed s/reCaptchaKey:.*/reCaptchaKey:\ $RECAPTCHA_SITE_KEY/ > /tmp/application.yml
mv -f /tmp/application.yml $AGATE_HOME/conf/application.yml
sed s/secret:\ 6Lfo7gYT.*/secret:\ $RECAPTCHA_SECRET_KEY/ $AGATE_HOME/conf/application-prod.yml | \
sed s/reCaptchaKey:.*/reCaptchaKey:\ $RECAPTCHA_SITE_KEY/ > /tmp/application-prod.yml
mv -f /tmp/application-prod.yml $AGATE_HOME/conf/application-prod.yml
fi
34 changes: 13 additions & 21 deletions bin/start.sh
Original file line number Diff line number Diff line change
@@ -16,8 +16,19 @@ if [ ! -d $AGATE_HOME/conf ]
mkdir -p $AGATE_HOME/conf
cp -r /usr/share/agate/conf/* $AGATE_HOME/conf
# So that application is accessible from outside of docker
sed s/address:\ localhost//g $AGATE_HOME/conf/application.yml > /tmp/application.yml && \
mv /tmp/application.yml $AGATE_HOME/conf/application.yml
sed s/address:\ localhost//g $AGATE_HOME/conf/application-prod.yml > /tmp/application-prod.yml && \
mv /tmp/application-prod.yml $AGATE_HOME/conf/application-prod.yml
fi

# Upgrade configuration
if [[ -f $AGATE_HOME/conf/application.yml && ! -f $AGATE_HOME/conf/application-prod.yml ]]
then
if grep -q "profiles:" $AGATE_HOME/conf/application.yml
then
cp $AGATE_HOME/conf/application.yml $AGATE_HOME/conf/application.yml.2.x
cat $AGATE_HOME/conf/application.yml.2.x | grep -v "profiles:" > $AGATE_HOME/conf/application.yml
fi
mv -f $AGATE_HOME/conf/application.yml $AGATE_HOME/conf/application-prod.yml
fi

# Check if 1st run. Then configure application.
@@ -27,24 +38,5 @@ if [ -e /opt/agate/bin/first_run.sh ]
mv /opt/agate/bin/first_run.sh /opt/agate/bin/first_run.sh.done
fi

# Upgrade to 3.x
if [ -e $AGATE_HOME/conf/application.yml ]
then
if grep -q "profiles:" $AGATE_HOME/conf/application.yml
then
cp $AGATE_HOME/conf/application.yml $AGATE_HOME/conf/application.yml.2.x
cat $AGATE_HOME/conf/application.yml.2.x | grep -v "profiles:" > $AGATE_HOME/conf/application.yml
fi
fi

# Wait for MongoDB to be ready
if [ -n "$MONGO_HOST" ]
then
until curl -i http://$MONGO_HOST:$MONGO_PORT/agate &> /dev/null
do
sleep 1
done
fi

# Start agate
/usr/share/agate/bin/agate
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
agate:
image: obiba/agate
image: obiba/agate:latest
#image: obiba/agate:test
ports:
- "8881:8081"
links:
@@ -17,7 +18,7 @@ services:
volumes:
- /tmp/agate:/srv
mongo:
image: mongo:6.0
image: mongo
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER:-obiba}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD:-password}
3 changes: 1 addition & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@
set -e

if [ "$1" = 'app' ]; then
chown -R agate "$AGATE_HOME"

chown -R agate:agate "$AGATE_HOME"
exec gosu agate /opt/agate/bin/start.sh
fi