No description
| frontend | ||
| .dockerignore | ||
| .woodpecker.env | ||
| .woodpecker.yml | ||
| Dockerfile | ||
| index.html | ||
| nginx.conf | ||
| README.md | ||
| woodpecker_lint.sh | ||
Demo CI Application
A simple demonstration application for Woodpecker CI with Forgejo Docker registry integration.
Overview
This project demonstrates:
- Building a Docker container with Woodpecker CI
- Pushing images to Forgejo's Docker package registry
- Automated CI/CD pipeline configuration
Files Structure
.
├── .woodpecker.yml # Woodpecker CI configuration
├── Dockerfile # Container build instructions
├── index.html # Demo application content
└── README.md # This file
Woodpecker CI Configuration
The .woodpecker.yml file defines a pipeline that:
- Build Step: Creates a Docker image tagged with commit SHA and latest
- Publish Step: Pushes the image to Forgejo's Docker registry (only on main branch)
- Cleanup Step: Removes unused Docker resources
Required Secrets
Configure these secrets in your Woodpecker CI settings:
registry_username: Your Forgejo usernameregistry_password: Your Forgejo password or access token
Environment Variables Used
CI_FORGE_URL: Automatically provided by Woodpecker (your Forgejo instance URL)CI_COMMIT_SHA: Git commit SHA for taggingCI_REPO_OWNER: Repository owner for namespacing
Docker Registry
Images are pushed to: {FORGEJO_URL}/{REPO_OWNER}/demo-app
Tags:
latest: Always points to the latest main branch build{commit-sha}: Specific commit builds for traceability
Local Development
Build locally:
docker build -t demo-app .
Run locally:
docker run -p 8080:80 demo-app
Then visit http://localhost:8080
Test the container:
# Health check
curl http://localhost:8080
# Check container logs
docker logs <container-id>
Deployment
The pipeline automatically:
- Triggers on pushes to main branch and pull requests
- Builds the Docker image
- Pushes to registry (main branch only)
- Cleans up build artifacts
Customization
To adapt this for your project:
- Update the
image_namevariable in.woodpecker.yml - Modify the
Dockerfilefor your application needs - Replace
index.htmlwith your application files - Adjust the pipeline steps as needed
Security Notes
- Uses Docker-in-Docker for container builds
- Registry credentials are securely managed via Woodpecker secrets
- Images are tagged with commit SHAs for traceability
- Cleanup step prevents disk space issues