Skip to content

Commit

Permalink
add images for generators (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm authored Jan 7, 2025
1 parent d82398d commit 1a4ed66
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/build-images-on-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- "src/loaders/**"
- "src/services/**"
- "src/databases/**"
- "scripts/docker-compose/**"
- "scripts/k8s/**"
- ".github/workflows/reusable-build-container-images.yml"
- ".github/workflows/build-images-on-commit.yml"
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-images-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- "src/loaders/**"
- "src/services/**"
- "src/databases/**"
- "scripts/docker-compose/**"
- "scripts/k8s/**"
- ".github/workflows/reusable-build-container-images.yml"
- ".github/workflows/check.yml"

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/reusable-build-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
name: services-nodejs
- context: ./src/databases/mysql
name: databases-mysql
- context: ./scripts/docker-compose
name: generators-docker-compose
- context: ./scripts/k8s
name: generators-k8s
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
Expand Down
9 changes: 9 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,12 @@ for DIR in "${REPO_DIR}/src/loaders"/*; do
docker buildx build --platform "$PLATFORM" -t "$IMAGE_TAG" $PUSH "$DIR" $PUSH
fi
done

for DIR in "${REPO_DIR}/scripts/generators"/*; do
if [ -d "$DIR" ]; then
IMAGE_TAG="${REPO_PREFIX}/${IMAGE_PREFIX}-generators-$(basename "$DIR"):$VERSION"
echo "Building $IMAGE_TAG..."
echo "Running 'docker buildx build --platform $PLATFORM -t $IMAGE_TAG $DIR $PUSH'"
docker buildx build --platform "$PLATFORM" -t "$IMAGE_TAG" $PUSH "$DIR" $PUSH
fi
done
2 changes: 1 addition & 1 deletion scripts/generators/docker-compose/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.14-alpine
FROM python:3.13-alpine

WORKDIR /app

Expand Down
21 changes: 21 additions & 0 deletions scripts/generators/k8s/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.13-alpine

WORKDIR /app

RUN apk addgroup -S appgroup && adduser -S appuser -G appgroup

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY createManifests.py .

COPY templates ./templates
COPY deployments ./deployments

RUN chown -R appuser:appgroup /app && chmod +x createManifests.py
USER appuser

VOLUME [ "/app/deployments" ]

# Define the default entrypoint to run the script
ENTRYPOINT ["python", "createManifests.py"]

0 comments on commit 1a4ed66

Please sign in to comment.