-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add support for using env vars, add a few more configs, build docker image #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…play - Add hideUrls boolean option to Config type - Update Status component to conditionally hide URLs based on config - Pass config through StatusGroup to Status components - Add example config.json demonstrating hideUrls feature - Update README.md with documentation for new hideUrls parameter - Maintains backward compatibility (URLs shown by default)
- Create multi-stage Dockerfile with Node.js build and nginx serve stages - Add runtime configuration generation via environment variables - Include nginx setup script with SPA routing and API proxy support - Add docker-compose.yml with comprehensive environment variable examples - Create .dockerignore for optimized build context - Update README.md with Docker deployment documentation and environment variables Docker features: - Uses secure 11notes/nginx base (rootless, distroless, 3.69MB) - Runtime config generation from environment variables - Security headers and optimizations - Health checks and read-only filesystem - Optional API proxying to Gatus backend - Support for all config options including hideUrls via CONFIG_HIDE_URLS
…latform Docker images
…angelog generation; remove obsolete release workflow
…d update Docker workflow configuration
BluemediaDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this PR. I commented on a couple of changes that I would like you to revise before I can merge this.
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Node.js 22.x
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Node.js 22.x
| - name: Generate commit-based changelog if no PRs found | ||
| id: commit_changelog | ||
| if: steps.changelog.outputs.changelog == '' || contains(steps.changelog.outputs.changelog, 'No pull requests found') | ||
| run: | | ||
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | ||
| # Get commits between tags | ||
| commits=$(git log --pretty=format:"%s (%h)" ${{ github.event.before }}..${{ github.sha }}) | ||
| # Categorize commits based on conventional commit prefixes | ||
| features=$(echo "$commits" | grep -E "^feat(\(.+\))?: " || true) | ||
| fixes=$(echo "$commits" | grep -E "^fix(\(.+\))?: " || true) | ||
| docs=$(echo "$commits" | grep -E "^docs(\(.+\))?: " || true) | ||
| style=$(echo "$commits" | grep -E "^style(\(.+\))?: " || true) | ||
| refactor=$(echo "$commits" | grep -E "^refactor(\(.+\))?: " || true) | ||
| perf=$(echo "$commits" | grep -E "^perf(\(.+\))?: " || true) | ||
| test=$(echo "$commits" | grep -E "^test(\(.+\))?: " || true) | ||
| build=$(echo "$commits" | grep -E "^(build|ci)(\(.+\))?: " || true) | ||
| chore=$(echo "$commits" | grep -E "^(chore|deps)(\(.+\))?: " || true) | ||
| other=$(echo "$commits" | grep -vE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|deps)(\(.+\))?: " || true) | ||
| # Generate categorized changelog | ||
| if [ -n "$features" ]; then | ||
| echo "## 🚀 Features" >> $GITHUB_OUTPUT | ||
| echo "$features" | sed 's/^feat[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$fixes" ]; then | ||
| echo "## 🐛 Bug Fixes" >> $GITHUB_OUTPUT | ||
| echo "$fixes" | sed 's/^fix[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$docs" ]; then | ||
| echo "## 📚 Documentation" >> $GITHUB_OUTPUT | ||
| echo "$docs" | sed 's/^docs[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$style" ]; then | ||
| echo "## 🎨 Code Style" >> $GITHUB_OUTPUT | ||
| echo "$style" | sed 's/^style[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$refactor" ]; then | ||
| echo "## ♻️ Refactoring" >> $GITHUB_OUTPUT | ||
| echo "$refactor" | sed 's/^refactor[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$perf" ]; then | ||
| echo "## ⚡ Performance" >> $GITHUB_OUTPUT | ||
| echo "$perf" | sed 's/^perf[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$test" ]; then | ||
| echo "## ✅ Tests" >> $GITHUB_OUTPUT | ||
| echo "$test" | sed 's/^test[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$build" ]; then | ||
| echo "## 🔧 Build & CI" >> $GITHUB_OUTPUT | ||
| echo "$build" | sed 's/^(build|ci)[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$chore" ]; then | ||
| echo "## ⤵️ Dependencies" >> $GITHUB_OUTPUT | ||
| echo "$chore" | sed 's/^(chore|deps)[^:]*: /- /' | sed 's/ (/ (/' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| if [ -n "$other" ]; then | ||
| echo "## 💭 Other Changes" >> $GITHUB_OUTPUT | ||
| echo "$other" | sed 's/^/- /' >> $GITHUB_OUTPUT | ||
| echo "" >> $GITHUB_OUTPUT | ||
| fi | ||
| echo "EOF" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't mikepenz/release-changelog-builder-action already handle this with the new configuration in HYBRID mode?
| ## 🐳 Docker Images | ||
| Multi-platform Docker images are available at: | ||
| ```bash | ||
| docker pull ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} | ||
| docker pull ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:latest | ||
| ``` | ||
| ## 🚀 Quick Start | ||
| ### Docker Run | ||
| ```bash | ||
| docker run -d -p 3000:80 \ | ||
| -e CONFIG_TITLE="My Status Page" \ | ||
| -e CONFIG_HIDE_URLS="true" \ | ||
| -e CONFIG_HIDE_FOOTER="true" \ | ||
| ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} | ||
| ``` | ||
| ### Docker Compose | ||
| ```yaml | ||
| version: '3.8' | ||
| services: | ||
| fancy-gatus: | ||
| image: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} | ||
| ports: | ||
| - "3000:80" | ||
| environment: | ||
| CONFIG_TITLE: "My Infrastructure Status" | ||
| CONFIG_GATUS_BASE_URL: "https://status.example.com" | ||
| CONFIG_HIDE_URLS: "false" | ||
| CONFIG_HIDE_FOOTER: "false" | ||
| ``` | ||
| ## 📦 Static Build | ||
| Download the static build zip file from the assets below and serve with any web server. | ||
| ## 🏗️ Supported Platforms | ||
| - linux/amd64 | ||
| - linux/arm64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to avoid including all this information with every release. In my opinion, this information should be included in the README instead.
| @@ -0,0 +1,37 @@ | |||
| # Build stage | |||
| FROM node:18-alpine AS builder | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also use Node.js 22 here.
| docker build -t fancy-gatus . | ||
| docker run -d -p 3000:80 \ | ||
| -e CONFIG_TITLE="My Status Page" \ | ||
| -e CONFIG_HIDE_URLS="true" \ | ||
| fancy-gatus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use the latest image from the registry than build the container again.
| #### Security Features | ||
|
|
||
| The Docker image includes several security features: | ||
| - Lightweight nginx:alpine base image | ||
| - Read-only filesystem | ||
| - Automatic security scanning | ||
| - Minimal attack surface | ||
| - Efficient Alpine Linux base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave that part out, as some of this is not true.
|
|
||
| services: | ||
| fancy-gatus: | ||
| build: . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I would rather use the latest image from the registry.
| NGINX_PORT: "80" | ||
|
|
||
| # Timezone | ||
| TZ: "UTC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The time zone isn't used anywhere, is it?
| server_tokens off; | ||
| # Access logs | ||
| access_log /var/log/nginx/access.log; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write the access log to stdout or disable it completely.
This pull request introduces Docker support for the project, enabling easy deployment using Docker and Docker Compose, and improves the release automation workflow. It adds a production-ready
Dockerfile, a sampledocker-compose.yml, and a comprehensive GitHub Actions workflow for building, testing, and publishing multi-platform Docker images and releases. Additionally, it updates documentation and configuration to reflect these new capabilities.Docker Support and Deployment
Dockerfilethat builds the frontend and serves it usingnginx:alpine, with runtime configuration via environment variables and included setup scripts.docker-compose.ymlfor local or production deployment, supporting environment-based configuration and health checks..dockerignoreto exclude unnecessary files from Docker build context, improving build efficiency and security.Release Automation and CI/CD
docker.yml) that builds, tests, and publishes multi-platform Docker images, generates changelogs, and creates GitHub Releases with attached static build artifacts. [1] [2]Documentation Updates
README.mdto include Docker deployment instructions, environment variable configuration, and security features of the Docker image.Changelog Generation Improvements