This is a Docker repository template for SBB Polarion Team projects | Read-only mirror of https://github.com/SchweizerischeBundesbahnen/open-source-polarion-docker-repo-template — SBB. Issues & pull requests at the source.
  • Dockerfile 86.9%
  • Python 13.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-03 10:58:38 +01:00
.github ci: trust organisation-owned actions in CodeQL Actions analysis 2026-12-03 10:58:38 +01:00
app
tests style: apply yamlfix formatting to YAML files 2026-03-11 15:55:03 +01:00
.gitignore
.pre-commit-config.yaml chore(deps): update pre-commit hook commitizen-tools/commitizen to v4.20.1 2026-11-27 11:50:18 +00:00
.tool-versions fix(deps): update dependency python to v3.15.2 2026-10-28 20:34:31 +00:00
CLAUDE.md docs: remove workflow pinning rule from CLAUDE.md (moved to core plugin) 2026-04-15 10:18:25 +02:00
CODING_STANDARDS.md
CONTRIBUTING.md refactor: restructure licensing for proper Apache 2.0 detection (#146) 2026-03-03 21:40:03 +01:00
DCO refactor: restructure licensing for proper Apache 2.0 detection (#146) 2026-03-03 21:40:03 +01:00
Dockerfile fix(deps): update ghcr.io/astral-sh/uv docker tag to v0.13.12 2026-12-02 00:41:40 +00:00
LICENSE feat(workflows): migrate to reusable workflows from github-workflows-polarion (#156) 2026-03-18 17:57:26 +01:00
NOTICE refactor: restructure licensing for proper Apache 2.0 detection (#146) 2026-03-03 21:40:03 +01:00
pyproject.toml fix(deps): update dependency coverage to v7.18.0 2026-12-03 00:59:15 +00:00
README.md docs(readme): add --init flag to all docker run examples (#158) 2026-03-18 18:02:50 +01:00
RELEASE.md
renovate.json
sonar-project.properties refactor: migrate from Poetry to uv 2026-03-11 15:52:17 +01:00
tox.ini refactor: migrate from Poetry to uv 2026-03-11 15:52:17 +01:00
uv.lock fix(deps): update dependency coverage to v7.18.0 2026-12-03 00:59:15 +00:00
zizmor.yml feat(workflows): migrate to reusable workflows from github-workflows-polarion (#156) 2026-03-18 17:57:26 +01:00

Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Reliability Rating Security Rating Maintainability Rating Vulnerabilities

<> Service

<< Short Description >>

Features

<< List of features >>

Getting Started

Installation

To install the latest version of the <> Service, run the following command:

docker pull ghcr.io/schweizerischebundesbahnen/<<docker-image-name>>:latest

Running the Service

To start the <> service container, execute:

  docker run --detach \
    --init \
    --publish <<port>>:<<port>> \
    --name <<docker-image-name>> \
    ghcr.io/schweizerischebundesbahnen/<<docker-image-name>>:latest

The service will be accessible on port <>.

Important: The --init flag enables Docker's built-in init process which handles signal forwarding and zombie process reaping. This is required for proper operation of the service.

Logging Configuration

The service includes a robust logging system with the following features:

  • Log files are stored in /opt/<<docker-image-name>>/logs directory
  • Log level can be configured via LOG_LEVEL environment variable (default: INFO)
  • Log format: timestamp - logger name - log level - message
  • Each service start creates a new timestamped log file

To customize logging when running the container:

docker run --detach \
  --init \
  --publish <<port>>:<<port>> \
  --name <<docker-image-name>> \
  --env LOG_LEVEL=DEBUG \
  --volume /path/to/local/logs:/opt/<<docker-image-name>>/logs \
  ghcr.io/schweizerischebundesbahnen/<<docker-image-name>>:latest

Available log levels:

  • DEBUG: Detailed information for debugging
  • INFO: General operational information (default)
  • WARNING: Warning messages for potential issues
  • ERROR: Error messages for failed operations
  • CRITICAL: Critical issues that require immediate attention

Using as a Base Image

To extend or customize the service, use it as a base image in the Dockerfile:

FROM ghcr.io/schweizerischebundesbahnen/<<docker-image-name>>:latest

Using Docker Compose

To run the service using Docker Compose:

docker-compose up -d

The Docker Compose configuration includes the init: true parameter which enables proper process management for the container.

Development

Building the Docker Image

To build the Docker image from the source with a custom version, use:

  docker build \
    --build-arg APP_IMAGE_VERSION=0.0.0 \
    --file Dockerfile \
    --tag <<docker-image-name>>:0.0.0 .

Replace 0.0.0 with the desired version number.

Running the Development Container

To start the Docker container with your custom-built image:

  docker run --detach \
    --init \
    --publish 9080:9080 \
    --name <<docker-container-name>> \
    <<docker-image-name>>:0.0.0

Stopping the Container

To stop the running container, execute:

  docker container stop <<docker-container-name>>

Testing

container-structure-test

The container-structure-test tool is used to verify that the Docker image meets expected standards and specifications. It validates the container structure, ensuring proper file paths, permissions, and commands are available, which helps maintain consistency and reliability of the containerized application.

Before running the following command, ensure that the container-structure-test tool is installed. You can find installation instructions in the official documentation.

container-structure-test test --image <<docker-container-name>>:0.0.0 --config ./tests/container/container-structure-test.yaml

grype

Grype is used for vulnerability scanning of the Docker image. This tool helps identify known security vulnerabilities in the dependencies and packages included in the container, ensuring the deployed application meets security standards and doesn't contain known exploitable components.

To scan the Docker image for vulnerabilities, you can use Grype. First, ensure that Grype is installed by following the installation instructions.

Then run the vulnerability scan on your image:

grype <<docker-container-name>>:0.0.0

tox

Tox automates testing in different Python environments, ensuring that the application works correctly across various Python versions and configurations. It helps maintain compatibility and provides a standardized way to run test suites, formatting checks, and other quality assurance processes.

uv run tox

pytest (for debugging)

Pytest is used for unit and integration testing of the application code. These tests verify that individual components and the entire application function correctly according to specifications. Running pytest during development helps catch bugs early and ensures code quality.

# all tests
uv run pytest
# a specific test
uv run pytest tests/test_app.py -v

pre-commit

Pre-commit hooks run automated checks on code before it's committed to the repository. This ensures consistent code style, formatting, and quality across the project. It helps catch common issues early in the development process, maintaining high code standards and reducing the need for style-related revisions during code reviews.

uv run pre-commit run --all

REST API

This service provides REST API. OpenAPI Specification can be obtained here.