Skip to content

Commit 81419b8

Browse files
authored
Merge pull request #3783 from akto-api-security/abhi/feat/account-job-scheduler
feat: add dockerfile and staging build
2 parents aa9aee3 + cdb4804 commit 81419b8

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

.github/workflows/staging.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ jobs:
101101
docker buildx build --platform linux/arm64/v8,linux/amd64 -t $ECR_REGISTRY/akto-threat-detection:$IMAGE_TAG . --push
102102
cd ../threat-detection-backend
103103
docker buildx build --platform linux/arm64/v8,linux/amd64 -t $ECR_REGISTRY/akto-threat-detection-backend:$IMAGE_TAG . --push
104+
cd ../account-job-executor
105+
docker buildx build --platform linux/arm64/v8,linux/amd64 -t $ECR_REGISTRY/akto-account-job-executor:$IMAGE_TAG . --push
104106
105107
- name: Set up JDK 11
106108
uses: actions/setup-java@v1
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Maven
2+
target/
3+
!target/*.jar
4+
pom.xml
5+
6+
# IDE
7+
.idea/
8+
*.iml
9+
.vscode/
10+
.classpath
11+
.project
12+
.settings/
13+
14+
# Git
15+
.git/
16+
.gitignore
17+
18+
# Logs
19+
*.log
20+
21+
# Documentation
22+
README.md
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use Amazon Corretto JRE 8
2+
FROM amazoncorretto:8
3+
4+
WORKDIR /app
5+
6+
# Copy the JAR file
7+
COPY ./target/account-job-executor-1.0-SNAPSHOT-jar-with-dependencies.jar /app/account-job-executor.jar
8+
9+
# Copy start script
10+
COPY start.sh /app/start.sh
11+
12+
# Make start script executable
13+
RUN chmod +x /app/start.sh
14+
15+
# Set default environment variables (can be overridden)
16+
ENV DATABASE_ABSTRACTOR_SERVICE_URL="" \
17+
DATABASE_ABSTRACTOR_SERVICE_TOKEN="" \
18+
AZURE_BINARY_STORAGE_CONNECTION_STRING="" \
19+
AZURE_BINARY_BLOB_URL="" \
20+
AKTO_LOG_LEVEL="INFO"
21+
22+
# Health check
23+
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
24+
CMD pgrep -f account-job-executor || exit 1
25+
26+
# Run the service
27+
CMD ["/app/start.sh"]

apps/account-job-executor/start.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
echo "=========================================="
4+
echo "Starting Account Job Executor Service"
5+
echo "=========================================="
6+
7+
# Validate required environment variables
8+
if [ -z "$DATABASE_ABSTRACTOR_SERVICE_URL" ]; then
9+
echo "ERROR: DATABASE_ABSTRACTOR_SERVICE_URL is not set"
10+
exit 1
11+
fi
12+
13+
if [ -z "$DATABASE_ABSTRACTOR_SERVICE_TOKEN" ]; then
14+
echo "ERROR: DATABASE_ABSTRACTOR_SERVICE_TOKEN is not set"
15+
exit 1
16+
fi
17+
18+
echo "Configuration:"
19+
echo " Cyborg URL: $DATABASE_ABSTRACTOR_SERVICE_URL"
20+
echo " Log Level: ${AKTO_LOG_LEVEL:-INFO}"
21+
echo "=========================================="
22+
23+
# Run the JAR
24+
exec java \
25+
-XX:+ExitOnOutOfMemoryError \
26+
-jar /app/account-job-executor.jar

0 commit comments

Comments
 (0)