Skip to content

Commit 32550fe

Browse files
authored
fix: project improvements and best practices (#97)
* fix: project improvements and best practices - Fix Go version: 1.24.0 → 1.23 (use stable release) - Add HEALTHCHECK to FastAPI Dockerfile for container self-healing - Remove duplicate httpx dependency from fastapi/requirements.txt - Add .dockerignore files to all reference apps (reduces image size) - Remove Cargo.lock from .gitignore (enables reproducible Rust builds) - Track Cargo.lock for rust reference app * fix: revert Go version to 1.24.0 (required by dependencies) golang.org/x/net@v0.47.0 requires go >= 1.24.0
1 parent 80a0686 commit 32550fe

10 files changed

Lines changed: 5017 additions & 2 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ package-lock.json.bak
9393

9494
# Rust
9595
target/
96-
Cargo.lock
9796

9897
# Test cache
9998
.pytest_cache/
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
.venv/
8+
venv/
9+
ENV/
10+
*.egg-info/
11+
.eggs/
12+
dist/
13+
build/
14+
15+
# Testing
16+
.pytest_cache/
17+
.coverage
18+
htmlcov/
19+
.tox/
20+
21+
# IDE
22+
.vscode/
23+
.idea/
24+
*.iml
25+
26+
# Git
27+
.git/
28+
.gitignore
29+
30+
# Environment
31+
.env
32+
.env.*
33+
*.env
34+
35+
# OS
36+
.DS_Store
37+
Thumbs.db
38+
39+
# Documentation
40+
*.md
41+
!README.md
42+
docs/
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
.venv/
8+
venv/
9+
ENV/
10+
*.egg-info/
11+
.eggs/
12+
dist/
13+
build/
14+
15+
# Testing
16+
.pytest_cache/
17+
.coverage
18+
htmlcov/
19+
.tox/
20+
21+
# IDE
22+
.vscode/
23+
.idea/
24+
*.iml
25+
26+
# Git
27+
.git/
28+
.gitignore
29+
30+
# Environment
31+
.env
32+
.env.*
33+
*.env
34+
35+
# OS
36+
.DS_Store
37+
Thumbs.db
38+
39+
# Documentation
40+
*.md
41+
!README.md
42+
docs/

reference-apps/fastapi/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ USER appuser
2929
# Expose ports (HTTP and HTTPS)
3030
EXPOSE 8000 8443
3131

32+
# Health check
33+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
34+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
35+
3236
# Run initialization script (which calls start.sh)
3337
CMD ["/app/init.sh"]

reference-apps/fastapi/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ pytest==9.0.2
3434
pytest-asyncio==1.3.0
3535
pytest-cov==7.0.0
3636
pytest-mock==3.15.1
37-
httpx==0.28.1 # Already listed above but needed for testing
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Go
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
*.test
8+
*.out
9+
vendor/
10+
11+
# IDE
12+
.vscode/
13+
.idea/
14+
*.iml
15+
16+
# Git
17+
.git/
18+
.gitignore
19+
20+
# Environment
21+
.env
22+
.env.*
23+
*.env
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Documentation
30+
*.md
31+
!README.md
32+
docs/
33+
34+
# Build artifacts
35+
bin/
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Node.js
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
.npm/
7+
.yarn/
8+
9+
# Build
10+
dist/
11+
build/
12+
coverage/
13+
14+
# IDE
15+
.vscode/
16+
.idea/
17+
*.iml
18+
19+
# Git
20+
.git/
21+
.gitignore
22+
23+
# Environment
24+
.env
25+
.env.*
26+
*.env
27+
28+
# OS
29+
.DS_Store
30+
Thumbs.db
31+
32+
# Documentation
33+
*.md
34+
!README.md
35+
docs/
36+
37+
# Test
38+
.nyc_output/

reference-apps/rust/.dockerignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Rust
2+
target/
3+
**/*.rs.bk
4+
Cargo.lock
5+
6+
# IDE
7+
.vscode/
8+
.idea/
9+
*.iml
10+
11+
# Git
12+
.git/
13+
.gitignore
14+
15+
# Environment
16+
.env
17+
.env.*
18+
*.env
19+
20+
# OS
21+
.DS_Store
22+
Thumbs.db
23+
24+
# Documentation
25+
*.md
26+
!README.md
27+
docs/

0 commit comments

Comments
 (0)