Skip to content
Merged
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
48 changes: 48 additions & 0 deletions .github/workflows/admin-utils-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Push Admin Utils Image

on:
push:
branches:
- develop
- master
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@v3

- name: Configure AWS credentials (Dev Account)
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_DEV }}
aws-region: ${{ secrets.CDK_REGION_DEV }}

- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.login-ecr.outputs.registry }}/rems-admin-utils
tags: |
type=ref,event=branch
type=sha
${{ github.ref == 'refs/heads/master' && 'latest' || '' }}

- name: Build and push Admin Utils image
uses: docker/build-push-action@v5
with:
context: .
file: adminUtils.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
24 changes: 24 additions & 0 deletions adminUtils.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# adminUtils.Dockerfile
# Pin to postgres:15 on Debian; if you want fewer surprises, you can use :15-bookworm
FROM postgres:15

ENV DEBIAN_FRONTEND=noninteractive

# Minimal, useful admin tooling; netcat-openbsd provides nc
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
jq \
vim-tiny \
less \
procps \
netcat-openbsd \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# You'll exec with /bin/bash; ensure it's present (it is on postgres:15, but harmless to add)
# RUN apt-get update && apt-get install -y --no-install-recommends bash && rm -rf /var/lib/apt/lists/*

# Nothing else needed; ECS Exec will override the command (e.g., /bin/bash)