Skip to content

Commit

Permalink
chore: Optimize Dockerfiles and CI workflow for improved build effici…
Browse files Browse the repository at this point in the history
…ency
  • Loading branch information
neumachen committed Dec 9, 2024
1 parent e0fb4e2 commit fff3094
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,3 @@ jobs:
type=registry,ref=specterops/bloodhound:buildcache
image_cache_to: |-
type=registry,ref=specterops/bloodhound:buildcache,mode=max
10 changes: 7 additions & 3 deletions tools/docker-compose/pgadmin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# SPDX-License-Identifier: Apache-2.0

FROM docker.io/dpage/pgadmin4
FROM docker.io/dpage/pgadmin4:8.13.0

# Add bh server config
COPY configs/pgadmin/servers.json /pgadmin4/servers.json
Expand All @@ -23,6 +23,10 @@ COPY configs/pgadmin/servers.json /pgadmin4/servers.json
RUN mkdir -p /var/lib/pgadmin/storage/bloodhound_specterops.io/
COPY configs/pgadmin/pgpass /var/lib/pgadmin/storage/bloodhound_specterops.io/pgpass

# Give pgadmin ownership or it will be owned by root and set u(rw) for password file or pgadmin will not use the file
# Give pgadmin ownership or it will be owned by root and set u(rw) for password
# file or pgadmin will not use the file
USER root
RUN chown -R pgadmin /var/lib/pgadmin && chmod 600 /var/lib/pgadmin/storage/bloodhound_specterops.io/pgpass
RUN chown -R pgadmin /var/lib/pgadmin && \
chmod 600 /var/lib/pgadmin/storage/bloodhound_specterops.io/pgpass

USER pgadmin
33 changes: 18 additions & 15 deletions tools/docker-compose/ui.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@
FROM docker.io/library/node:22-alpine AS base

# Setup
RUN mkdir /.yarn && chmod -R go+w /.yarn
RUN mkdir /.cache && chmod -R go+w /.cache
RUN corepack enable
RUN corepack prepare yarn@stable --activate
RUN mkdir /.yarn && \
chmod -R go+w /.yarn \
mkdir /.cache && \
chmod -R go+w /.cache && \
correpack enable && \
corepack prepare yarn@stable --activate

# BloodHound Workspace files
WORKDIR /bloodhound
COPY package.json ./
COPY yarn.lock ./
COPY .yarnrc.yml ./
COPY .yarn ./.yarn

COPY package.json \
yarn.lock \
.yarnrc.yml \
.yarn \
./

# Shared Project Files
WORKDIR /bloodhound/packages/javascript
Expand All @@ -36,13 +40,12 @@ COPY packages/javascript/js-client-library/package.json ./js-client-library/

# BloodHound Project Files
WORKDIR /bloodhound/cmd/ui
COPY cmd/ui/package.json ./
COPY cmd/ui/vite.config.ts ./
COPY cmd/ui/tsconfig.node.json ./
COPY cmd/ui/tsconfig.json ./
COPY cmd/ui/package.json \
cmd/ui/vite.config.ts \
cmd/ui/tsconfig.node.json \
cmd/ui/tsconfig.json \
cmd/ui/index.html \
./
COPY cmd/ui/public ./public
COPY cmd/ui/index.html ./

WORKDIR /bloodhound/cmd/ui

RUN yarn

0 comments on commit fff3094

Please sign in to comment.