Skip to content
Open
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
36 changes: 22 additions & 14 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
validate-compose:
name: Validate Docker Compose
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Validate docker-compose.yml syntax
run: |
Expand Down Expand Up @@ -46,7 +48,7 @@ jobs:

- name: Check for leaked secrets
run: |
if git ls-files | xargs grep -l "CHANGE_ME" | grep -v ".env.example" | grep -v ".github/workflows/"; then
if git ls-files | xargs grep -l "CHANGE_ME" | grep -v ".env.example" | grep -v ".github/workflows/" | grep -v "Makefile"; then
echo "❌ Found placeholder passwords in tracked files"
exit 1
fi
Expand All @@ -62,34 +64,34 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ghcr.io/${{ github.repository }}/moodle
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix={{branch}}-
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Build Moodle image
uses: docker/build-push-action@v5
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: ./docker/moodle
file: ./docker/moodle/Dockerfile
Expand All @@ -100,7 +102,7 @@ jobs:
cache-to: type=gha,mode=max

- name: Build test image for validation
uses: docker/build-push-action@v5
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: ./docker/moodle
file: ./docker/moodle/Dockerfile
Expand Down Expand Up @@ -156,10 +158,12 @@ jobs:
name: Test Stack Startup
runs-on: ubuntu-latest
needs: build-moodle-image
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Clone Moodle
run: |
Expand Down Expand Up @@ -254,16 +258,18 @@ jobs:
name: Security Scan
runs-on: ubuntu-latest
needs: build-moodle-image
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build Moodle image
run: docker build -t moodle:scan ./docker/moodle

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # master
with:
image-ref: 'moodle:scan'
format: 'table'
Expand All @@ -273,12 +279,14 @@ jobs:
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v14
uses: DavidAnson/markdownlint-cli2-action@07035fd053f7be764496c0f8d8f9f41f98305101 # v22.0.0
with:
globs: '*.md'
2 changes: 1 addition & 1 deletion QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ docker compose exec database mysqldump -u root -p moodle | gzip > backup-$(date
## What's Running?

| Service | Purpose | Port | Access |
|---------|---------|------|--------|
| ------- | ------- | ---- | ------ |
| Moodle | Web application | 8080 | http://localhost:8080 |
| MariaDB | Database | - | Internal only |
| Valkey | Cache + Sessions | - | Internal only |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ docker compose exec moodle php admin/cli/purge_caches.php
docker compose exec moodle php admin/cli/maintenance.php --disable
```

## Traefik Integration
## Manual Traefik Configuration

To enable Traefik reverse proxy with automatic SSL:

Expand Down
Loading