Skip to content
Closed
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
1 change: 0 additions & 1 deletion src/ServiceControl.RavenDB/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ RUN chown 999:999 /var/lib/ravendb/data
USER ravendb

ENV RAVEN_License_Eula_Accepted=true \
RAVEN_License_Path=/usr/lib/ravendb/servicecontrol-license.json \
RAVEN_Setup_Mode=None

LABEL org.opencontainers.image.source=https://github.com/Particular/ServiceControl \
Expand Down
29 changes: 28 additions & 1 deletion src/ServiceControl.RavenDB/sc-container-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,31 @@ if [[ -d "$LEGACY_PATH" ]]; then
exit 1
fi

source /usr/lib/ravendb/scripts/run-raven.sh
source /usr/lib/ravendb/scripts/run-raven.sh &
RAVEN_PID=$!

# Wait for RavenDB to be ready (with retries)
echo "Waiting for RavenDB to start..."
for i in {1..30}; do
if curl -s http://localhost:8080/admin/stats > /dev/null 2>&1; then
echo "RavenDB is ready!"
break
fi
sleep 1
done

# Register license
echo "Registering license..."
LICENSE_JSON=$(cat /usr/lib/ravendb/servicecontrol-license.json)
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST http://localhost:8080/admin/license/activate \
-H "Content-Type: application/json" \
-d "$LICENSE_JSON")

HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
if [ "$HTTP_CODE" -eq 200 ] || [ "$HTTP_CODE" -eq 204 ]; then
echo "License registered successfully!"
else
echo "Warning: License registration returned HTTP $HTTP_CODE"
fi

wait $RAVEN_PID