Skip to content

Commit b812346

Browse files
feat: remove Dockerfile and npm configuration files (#24)
Co-authored-by: Thomas Bernhard <167410028+tbernhard-fullstacks@users.noreply.github.com>
1 parent f1705be commit b812346

File tree

94 files changed

+446
-2668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+446
-2668
lines changed

.github/workflows/docker-build.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,28 @@ jobs:
3030
username: ${{ github.actor }}
3131
password: ${{ secrets.GITHUB_TOKEN }}
3232

33-
- name: Build Docker image
33+
- name: Build & Push Vanilla Docker image
3434
run: |
35-
docker build -t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME} .
35+
docker build \
36+
-f docker/Dockerfile \
37+
-t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME} \
38+
-t ghcr.io/${{ steps.repo.outputs.repo }}:latest \
39+
.
3640
37-
- name: Push Docker image
41+
docker push ghcr.io/${{ steps.repo.outputs.repo }} --all-tags
42+
43+
- name: Build & Push Scanner specific Docker image
3844
run: |
39-
docker push ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME}
45+
docker build \
46+
-f docker/cnspec.Dockerfile \
47+
-t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME}-cnspec \
48+
-t ghcr.io/${{ steps.repo.outputs.repo }}:latest-cnspec \
49+
.
50+
51+
docker build \
52+
-f docker/snyk.Dockerfile \
53+
-t ghcr.io/${{ steps.repo.outputs.repo }}:${GITHUB_REF_NAME}-snyk \
54+
-t ghcr.io/${{ steps.repo.outputs.repo }}:latest-snyk \
55+
.
56+
57+
docker push ghcr.io/${{ steps.repo.outputs.repo }} --all-tags

.pre-commit-config.yaml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
repos:
33
# overall file checks
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-yaml
88
args:
99
- --allow-multiple-documents
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
1212
- id: check-added-large-files
13-
- id: check-byte-order-marker
13+
- id: fix-byte-order-marker
1414
- id: check-executables-have-shebangs
1515
- id: check-json
1616
- id: check-merge-conflict
@@ -26,10 +26,12 @@ repos:
2626
exclude: |
2727
(?x)(
2828
^creds/|
29+
^docs/|
2930
^README.md
3031
)
3132
- id: name-tests-test
32-
args: [--pytest-test-first]
33+
args: [ --pytest-test-first ]
34+
3335
# commit-message & author
3436
# https://jorisroovers.com/gitlint/
3537
- repo: https://github.com/jorisroovers/gitlint
@@ -44,32 +46,28 @@ repos:
4446
- -cgeneral.staged=true
4547
- -ctitle-max-length.line-length=80
4648
- '-ctitle-match-regex.regex=^(feat|fix|try|maintain)!?(\(.*\))?:.+|^Merge branch.*'
47-
- "-cauthor-valid-email.regex=[^@]+@fullstacks.eu"
4849
- --msg-filename
4950

5051
- repo: https://github.com/astral-sh/ruff-pre-commit
51-
rev: v0.12.4
52+
rev: v0.14.4
5253
hooks:
5354
- id: ruff
54-
args: [--fix]
55+
args: [ --fix ]
5556
- id: ruff-format
5657

57-
- repo: local
58+
# uv: Ensure lockfile consistency
59+
- repo: https://github.com/astral-sh/uv-pre-commit
60+
# uv version.
61+
rev: 0.9.8
5862
hooks:
59-
- id: pytest
60-
name: pytest
61-
entry: .venv/bin/pytest
62-
language: script
63-
types: [ python ]
64-
pass_filenames: false
65-
always_run: true
63+
- id: uv-lock
6664

6765
- repo: local
6866
hooks:
69-
- id: pylint
70-
name: pylint
71-
entry: .venv/bin/pylint src/
72-
language: script
67+
- id: pytest
68+
name: Run Pytest - 'uv run pytest'
69+
entry: uv run pytest
70+
language: system
7371
types: [ python ]
7472
pass_filenames: false
7573
always_run: true

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ We aim to foster an inclusive and welcoming community.
2929

3030
### Prerequisites
3131

32-
- Python 3.10 or higher
32+
- Python 3.12 or higher
3333
- Docker (for testing container functionality)
3434
- Git
35+
- [uv](https://github.com/astral-sh/uv) - A fast Python package installer and resolver
36+
3537

3638
### Setting Up Your Environment
3739

3840
1. Create a virtual environment:
3941

4042
``` bash
41-
python -m venv .venv
42-
source .venv/bin/activate
43+
uv venv
4344
```
4445

4546
1. Install development dependencies:
4647

4748
``` bash
48-
pip install -r requirements.txt
49-
pip install -r requirements-dev.txt
49+
uv sync --frozen
5050
```
5151

5252
## Coding Standards

Dockerfile

Lines changed: 0 additions & 52 deletions
This file was deleted.

docker/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ARG BASE_IMAGE_REGISTRY="library"
2+
ARG BASE_IMAGE_REPOSITORY="python"
3+
ARG BASE_IMAGE_TAG="3.12-alpine3.22"
4+
FROM ${BASE_IMAGE_REGISTRY}/${BASE_IMAGE_REPOSITORY}:${BASE_IMAGE_TAG}
5+
6+
ARG APP_COMMIT_SHA=""
7+
ARG APP_VERSION=""
8+
ENV APP_COMMIT_SHA=$APP_COMMIT_SHA
9+
ENV APP_VERSION=$APP_VERSION
10+
11+
# install uv
12+
COPY --from=docker.io/astral/uv@sha256:e4644cb5bd56fdc2c5ea3ee0525d9d21eed1603bccd6a21f887a938be7e85be1 /uv /uvx /bin/
13+
14+
# Install packages and CNSpec
15+
RUN apk update && \
16+
apk add --no-cache \
17+
git
18+
19+
# Create a non-root user and group
20+
RUN addgroup -S airgapper && adduser -S airgapper -G airgapper
21+
22+
USER airgapper
23+
24+
# Set working directory
25+
WORKDIR /home/airgapper
26+
27+
# Copy requirements first to leverage Docker cache
28+
COPY pyproject.toml uv.lock ./
29+
30+
# Install dependencies
31+
RUN uv sync --frozen # --no-dev
32+
33+
# Copy all local packages and files
34+
COPY src/ .
35+
36+
# Specify the command to run the app
37+
ENTRYPOINT ["uv", "run", "python", "main.py"]

docker/cnspec.Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG CNSPEC_VERSION="12.0.0"
2+
ARG BASE_IMAGE_REGISTRY="ghcr.io"
3+
ARG BASE_IMAGE_REPOSITORY="fullstacks-gmbh/universal-airgapper"
4+
ARG BASE_IMAGE_TAG="latest"
5+
FROM mondoo/cnspec:${CNSPEC_VERSION}-rootless AS cnspec
6+
7+
FROM ${BASE_IMAGE_REGISTRY}/${BASE_IMAGE_REPOSITORY}:${BASE_IMAGE_TAG}
8+
9+
COPY --from=cnspec /usr/local/bin/cnspec /usr/local/bin/cnspec

docker/snyk.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# snyk/snyk:alpine as of 9/15/2025
2+
ARG SNYK_VERSION="sha256:169b3545c8305d311d9756e3b60ce16de7ce35c92d90273def868c79f7a62fad"
3+
ARG BASE_IMAGE_REGISTRY="ghcr.io"
4+
ARG BASE_IMAGE_REPOSITORY="fullstacks-gmbh/universal-airgapper"
5+
ARG BASE_IMAGE_TAG="latest"
6+
FROM snyk/snyk@${SNYK_VERSION} AS snyk
7+
8+
FROM ${BASE_IMAGE_REGISTRY}/${BASE_IMAGE_REPOSITORY}:${BASE_IMAGE_TAG}
9+
10+
COPY --from=snyk /usr/local/bin/snyk /usr/local/bin/snyk

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
{
2-
description = "Airgapper dev environment";
2+
description = "FULLSTACKS Universal Airgapper Dev Env";
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
66
flake-utils.url = "github:numtide/flake-utils";
77
};
88

9-
outputs = { self, nixpkgs, flake-utils, ... }:
10-
flake-utils.lib.eachDefaultSystem (system:
9+
outputs =
10+
{
11+
nixpkgs,
12+
flake-utils,
13+
...
14+
}:
15+
flake-utils.lib.eachDefaultSystem (
16+
system:
1117
let
1218
pkgs = import nixpkgs { inherit system; };
13-
in {
19+
in
20+
{
1421
devShell = pkgs.mkShell {
1522
buildInputs = [
1623
pkgs.python312

0 commit comments

Comments
 (0)