Skip to content

Commit 7062bf3

Browse files
committed
docs(CONTRIBUTING.md): add contributing guidelines to assist new contributors
chore(.gitignore): update to ignore environment files and OS-specific files build(docker-compose.yml): use environment variables for Grafana configuration to enhance flexibility build(docker-compose.yml): add healthcheck and resource constraints for better container management
1 parent e74e32a commit 7062bf3

4 files changed

Lines changed: 116 additions & 3 deletions

File tree

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ GF_SECURITY_ADMIN_USER=yourusername
66
GF_SECURITY_ADMIN_PASSWORD=yourpassword
77
GF_INSTALL_PLUGINS=grafana-piechart-panel,grafana-worldmap-panel,grafana-clock-panel,grafana-simple-json-datasource
88
GF_LOG_MODE=console
9-

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,26 @@
22

33
!/.env
44
!/.gitignore
5+
!/CONTRIBUTING.md
56
!/docker-compose.yml
67
!/Dockerfile
78
!/LICENSE
89
!/railwayapp-grafana.png
910
!/README.md
11+
12+
# Environment variables
13+
.env
14+
15+
# Grafana data
16+
data/grafana/*
17+
data/plugins/*
18+
data/backup/*
19+
20+
# Keep directory structure
21+
!data/grafana/.gitkeep
22+
!data/plugins/.gitkeep
23+
!data/backup/.gitkeep
24+
25+
# OS files
26+
.DS_Store
27+
Thumbs.db

CONTRIBUTING.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Contributing Guidelines for Railway Grafana Template
2+
3+
Thank you for your interest in contributing to this project! These guidelines will help you contribute effectively.
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork:
9+
```bash
10+
git clone https://github.com/YOUR_USERNAME/railwayapp-grafana.git
11+
cd railwayapp-grafana
12+
```
13+
3. Create a new branch:
14+
```bash
15+
git checkout -b feature/your-feature
16+
```
17+
18+
## Development Environment
19+
20+
1. Copy the `.env.example` file:
21+
```bash
22+
cp .env.example .env
23+
```
24+
2. Adjust the values in the `.env` file
25+
3. Start the development environment:
26+
```bash
27+
docker-compose up -d
28+
```
29+
30+
## Pull Request Guidelines
31+
32+
1. Ensure your code follows the existing style
33+
2. Add tests when implementing new features
34+
3. Update documentation when necessary
35+
4. Describe your changes in the pull request
36+
37+
## Commit Messages
38+
39+
Use meaningful commit messages. A good format is:
40+
41+
```
42+
feat: Add new feature
43+
fix: Fix bug in X
44+
docs: Update documentation
45+
style: Improve code formatting
46+
refactor: Restructure code
47+
```
48+
49+
## Code Style
50+
51+
- Use meaningful variable names
52+
- Comment complex logic
53+
- Keep functions short and focused
54+
- Follow Docker best practices
55+
56+
## Testing
57+
58+
1. Ensure all tests pass successfully
59+
2. Add new tests for new features
60+
3. Test your changes locally before committing
61+
62+
## Documentation
63+
64+
- Update README.md for relevant changes
65+
- Document new features
66+
- Add comments to complex code
67+
68+
## Questions and Support
69+
70+
For questions or issues:
71+
1. Check the existing documentation
72+
2. Create an issue in the GitHub repository
73+
3. Describe the problem in detail
74+
75+
## License
76+
77+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
78+
79+
Thank you for your contributions!

docker-compose.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,32 @@ services:
99
restart: unless-stopped
1010
environment:
1111
- TZ=Europe/Amsterdam
12-
- GF_DEFAULT_INSTANCE_NAME=my-instance
13-
- GF_SECURITY_ADMIN_USER=owner
12+
- GF_DEFAULT_INSTANCE_NAME=${GF_DEFAULT_INSTANCE_NAME}
13+
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
14+
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
1415
- GF_LOG_MODE=console
16+
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
1517
ports:
1618
- 3000:3000
1719
volumes:
1820
- ./data/grafana:/var/lib/grafana
21+
- ./data/plugins:/var/lib/grafana/plugins
22+
- ./data/backup:/var/lib/grafana/backup
1923
networks:
2024
- regenfass
25+
healthcheck:
26+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
27+
interval: 30s
28+
timeout: 10s
29+
retries: 3
30+
deploy:
31+
resources:
32+
limits:
33+
cpus: '1'
34+
memory: 1G
35+
reservations:
36+
cpus: '0.5'
37+
memory: 512M
2138

2239
networks:
2340
regenfass:

0 commit comments

Comments
 (0)