Feature request: Docker image
I'd like to be able to deploy the streak-stats webserver using a docker container. This would make the selfhosting part so much easier, and needing less configuration. The optimal solution would be a image on dockerhub, but being able to build an image from the repo using a dockerfile would be a great startπ
This has been mentioned before in issue #318. Then someone tried to make some PRs, but there doesn't seem to be any progress after that #321 #322.
Is there anything we'll need to think about, other than not cluttering the repo root, like mentioned in the PRs?
I've started creating a dockerfile and testing the image. I've installed all the requirements and dependencies that are defined in CONTRIBUTING.md, and it seems like composer starts without any problems.
All the additions I made are documented in the following commit: https://github.com/NorskNoobing/github-readme-streak-stats/commit/9c7a16da7ae3a9775b7e1c13757df3bb3e225a7c
Issue
When I go to the http://localhost:8000 website I get the error The connection was reset.
Then I tried stopping the container, and I got the error Unable to connect.
So it seems like the container actually does something, and creates some type of webserver, but I can't actually load the website.
Composer test
After discovering the issue, I tried to run composer test and got some failures. They may or may not be related to my problem, so I'm listing them here just in case.
CLICK HERE - To see composer test log
> ./vendor/bin/phpunit --testdox tests
PHPUnit 9.6.13 by Sebastian Bergmann and contributors.
Options
β Themes
β Fallback to default theme
β Themes have valid parameters
β Color override parameters
β Valid color inputs
β Invalid color inputs
β Hide border
β Date format same year
β Date format different year
β Date format no brackets diff year
β Date format no brackets same year
β Normalize theme name
β All theme names normalized
Render
β Card render
β Error card render
β Date format render
β Locale render date format
β Border radius
β Split lines
β Disable animations
β Alpha in hex colors
β Gradient background
β Gradient background with more than 2 colors
β Exclude days
β Card width
β First and third columns swapped when direction is rtl
β
β Failed asserting that '<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'\r
β style='isolation: isolate' viewBox='0 0 495 195' width='495px' height='195px' direction='rtl'>\r
β <style>\r
β @keyframes currstreak {\r
β 0% { font-size: 3px; opacity: 0.2; }\r
β 80% { font-size: 34px; opacity: 1; }\r
β 100% { font-size: 28px; opacity: 1; }\r
β }\r
β @keyframes fadein {\r
β 0% { opacity: 0; }\r
β 100% { opacity: 1; }\r
β }\r
β </style>\r
β <defs>\r
β <clipPath id='outer_rectangle'>\r
β <rect width='495' height='195' rx='4.5'/>\r
β </clipPath>\r
β <mask id='mask_out_ring_behind_fire'>\r
β <rect width='495' height='195' fill='white'/>\r
β <ellipse id='mask-ellipse' cx='247.5' cy='32' rx='13' ry='18' fill='black'/>\r
β </mask>\r
β </defs>\r
β <g clip-path='url(#outer_rectangle)'>\r
β <g style='isolation: isolate'>\r
β <rect stroke='#111111' fill='#000000' rx='4.5' x='0.5' y='0.5' width='494' height='194'/>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <line x1='165' y1='28' x2='165' y2='170' vector-effect='non-scaling-stroke' stroke-width='1' stroke='#222222' stroke-linejoin='miter' stroke-linecap='square' stroke-miterlimit='3'/>\r
β <line x1='330' y1='28' x2='330' y2='170' vector-effect='non-scaling-stroke' stroke-width='1' stroke='#222222' stroke-linejoin='miter' stroke-linecap='square' stroke-miterlimit='3'/>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <!-- Total Contributions big number -->\r
β <g transform='translate(412.5,48)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#666666' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='28px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.6s'>\r
β 2,048\r
β </text>\r
β </g>\r
β <!-- Total Contributions label -->\r
β <g transform='translate(412.5,84)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#888888' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='14px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.7s'>\r
β Χ‘ΧΧΧ ΧΧͺΧ¨ΧΧΧΧͺ\r
β </text>\r
β </g>\r
β <!-- Total Contributions range -->\r
β <g transform='translate(412.5,114)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#999999' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='12px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.8s'>\r
β 10 ΧΧΧΧΧ³ 2016 - ΧΧΧΧ\r
β </text>\r
β </g>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <!-- Current Streak big number -->\r
β <g transform='translate(247.5,48)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#555555' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='28px' font-style='normal' style='animation: currstreak 0.6s linear forwards'>\r
β 16\r
β </text>\r
β </g>\r
β <!-- Current Streak label -->\r
β <g transform='translate(247.5,108)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#777777' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='14px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.9s'>\r
β Χ¨Χ¦Χ£ Χ ΧΧΧΧ\r
β </text>\r
β </g>\r
β <!-- Current Streak range -->\r
β <g transform='translate(247.5,145)'>\r
β <text x='0' y='21' stroke-width='0' text-anchor='middle' fill='#999999' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='12px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.9s'>\r
β <tspan x='0' dy='0'>28 ΧΧΧ¨Χ₯ 2019</tspan><tspan x='0' dy='16'>- 12 ΧΧΧ€Χ¨Χ³ 2019</tspan>\r
β </text>\r
β </g>\r
β <!-- Ring around number -->\r
β <g mask='url(#mask_out_ring_behind_fire)'>\r
β <circle cx='247.5' cy='71' r='40' fill='none' stroke='#333333' stroke-width='5' style='opacity: 0; animation: fadein 0.5s linear forwards 0.4s'></circle>\r
β </g>\r
β <!-- Fire icon -->\r
β <g transform='translate(247.5, 19.5)' stroke-opacity='0' style='opacity: 0; animation: fadein 0.5s linear forwards 0.6s'>\r
β <path d='M -12 -0.5 L 15 -0.5 L 15 23.5 L -12 23.5 L -12 -0.5 Z' fill='none'/>\r
β <path d='M 1.5 0.67 C 1.5 0.67 2.24 3.32 2.24 5.47 C 2.24 7.53 0.89 9.2 -1.17 9.2 C -3.23 9.2 -4.79 7.53 -4.79 5.47 L -4.76 5.11 C -6.78 7.51 -8 10.62 -8 13.99 C -8 18.41 -4.42 22 0 22 C 4.42 22 8 18.41 8 13.99 C 8 8.6 5.41 3.79 1.5 0.67 Z M -0.29 19 C -2.07 19 -3.51 17.6 -3.51 15.86 C -3.51 14.24 -2.46 13.1 -0.7 12.74 C 1.07 12.38 2.9 11.53 3.92 10.16 C 4.31 11.45 4.51 12.81 4.51 14.2 C 4.51 16.85 2.36 19 -0.29 19 Z' fill='#444444' stroke-opacity='0'/>\r
β </g>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <!-- Longest Streak big number -->\r
β <g transform='translate(82.5,48)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#666666' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='28px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 1.2s'>\r
β 86\r
β </text>\r
β </g>\r
β <!-- Longest Streak label -->\r
β <g transform='translate(82.5,84)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#888888' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='14px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 1.3s'>\r
β Χ¨Χ¦Χ£ ΧΧΧ ΧΧ¨ΧΧ\r
β </text>\r
β </g>\r
β <!-- Longest Streak range -->\r
β <g transform='translate(82.5,114)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#999999' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='12px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 1.4s'>\r
β <tspan x='0' dy='0'>19 ΧΧΧ¦ΧΧ³ 2016</tspan><tspan x='0' dy='16'>- 14 ΧΧΧ¨Χ₯ 2016</tspan>\r
β </text>\r
β </g>\r
β </g>\r
β </g>\r
β </svg>\r
β ' contains "<!-- Total Contributions big number -->
β <g transform='translate(412.5,48)'>".
β
β /mnt/github-readme-streak-stats/tests/RenderTest.php:245
β
β Exclude days parameter
Stats
β Valid username
β Override starting year
β Invalid username
β Organization name
β Contributed today
β Missing today
β Missing two days
β Multiple year streak
β Future commits
β Weekly stats
β Weekly stats missing week
β Weekly stats missing this week
β Exclude days
β Exclude days no contribution before weekend
Translations
β All phrases valid
β Locales sorted alphabetically
β Keys normalized
β Get translations
β Normalize locale code
Time: 00:03.647, Memory: 8.00 MB
Summary of non-successful tests:
Render
β First and third columns swapped when direction is rtl
β
β Failed asserting that '<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'\r
β style='isolation: isolate' viewBox='0 0 495 195' width='495px' height='195px' direction='rtl'>\r
β <style>\r
β @keyframes currstreak {\r
β 0% { font-size: 3px; opacity: 0.2; }\r
β 80% { font-size: 34px; opacity: 1; }\r
β 100% { font-size: 28px; opacity: 1; }\r
β }\r
β @keyframes fadein {\r
β 0% { opacity: 0; }\r
β 100% { opacity: 1; }\r
β }\r
β </style>\r
β <defs>\r
β <clipPath id='outer_rectangle'>\r
β <rect width='495' height='195' rx='4.5'/>\r
β </clipPath>\r
β <mask id='mask_out_ring_behind_fire'>\r
β <rect width='495' height='195' fill='white'/>\r
β <ellipse id='mask-ellipse' cx='247.5' cy='32' rx='13' ry='18' fill='black'/>\r
β </mask>\r
β </defs>\r
β <g clip-path='url(#outer_rectangle)'>\r
β <g style='isolation: isolate'>\r
β <rect stroke='#111111' fill='#000000' rx='4.5' x='0.5' y='0.5' width='494' height='194'/>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <line x1='165' y1='28' x2='165' y2='170' vector-effect='non-scaling-stroke' stroke-width='1' stroke='#222222' stroke-linejoin='miter' stroke-linecap='square' stroke-miterlimit='3'/>\r
β <line x1='330' y1='28' x2='330' y2='170' vector-effect='non-scaling-stroke' stroke-width='1' stroke='#222222' stroke-linejoin='miter' stroke-linecap='square' stroke-miterlimit='3'/>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <!-- Total Contributions big number -->\r
β <g transform='translate(412.5,48)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#666666' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='28px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.6s'>\r
β 2,048\r
β </text>\r
β </g>\r
β <!-- Total Contributions label -->\r
β <g transform='translate(412.5,84)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#888888' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='14px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.7s'>\r
β Χ‘ΧΧΧ ΧΧͺΧ¨ΧΧΧΧͺ\r
β </text>\r
β </g>\r
β <!-- Total Contributions range -->\r
β <g transform='translate(412.5,114)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#999999' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='12px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.8s'>\r
β 10 ΧΧΧΧΧ³ 2016 - ΧΧΧΧ\r
β </text>\r
β </g>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <!-- Current Streak big number -->\r
β <g transform='translate(247.5,48)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#555555' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='28px' font-style='normal' style='animation: currstreak 0.6s linear forwards'>\r
β 16\r
β </text>\r
β </g>\r
β <!-- Current Streak label -->\r
β <g transform='translate(247.5,108)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#777777' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='14px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.9s'>\r
β Χ¨Χ¦Χ£ Χ ΧΧΧΧ\r
β </text>\r
β </g>\r
β <!-- Current Streak range -->\r
β <g transform='translate(247.5,145)'>\r
β <text x='0' y='21' stroke-width='0' text-anchor='middle' fill='#999999' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='12px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 0.9s'>\r
β <tspan x='0' dy='0'>28 ΧΧΧ¨Χ₯ 2019</tspan><tspan x='0' dy='16'>- 12 ΧΧΧ€Χ¨Χ³ 2019</tspan>\r
β </text>\r
β </g>\r
β <!-- Ring around number -->\r
β <g mask='url(#mask_out_ring_behind_fire)'>\r
β <circle cx='247.5' cy='71' r='40' fill='none' stroke='#333333' stroke-width='5' style='opacity: 0; animation: fadein 0.5s linear forwards 0.4s'></circle>\r
β </g>\r
β <!-- Fire icon -->\r
β <g transform='translate(247.5, 19.5)' stroke-opacity='0' style='opacity: 0; animation: fadein 0.5s linear forwards 0.6s'>\r
β <path d='M -12 -0.5 L 15 -0.5 L 15 23.5 L -12 23.5 L -12 -0.5 Z' fill='none'/>\r
β <path d='M 1.5 0.67 C 1.5 0.67 2.24 3.32 2.24 5.47 C 2.24 7.53 0.89 9.2 -1.17 9.2 C -3.23 9.2 -4.79 7.53 -4.79 5.47 L -4.76 5.11 C -6.78 7.51 -8 10.62 -8 13.99 C -8 18.41 -4.42 22 0 22 C 4.42 22 8 18.41 8 13.99 C 8 8.6 5.41 3.79 1.5 0.67 Z M -0.29 19 C -2.07 19 -3.51 17.6 -3.51 15.86 C -3.51 14.24 -2.46 13.1 -0.7 12.74 C 1.07 12.38 2.9 11.53 3.92 10.16 C 4.31 11.45 4.51 12.81 4.51 14.2 C 4.51 16.85 2.36 19 -0.29 19 Z' fill='#444444' stroke-opacity='0'/>\r
β </g>\r
β </g>\r
β <g style='isolation: isolate'>\r
β <!-- Longest Streak big number -->\r
β <g transform='translate(82.5,48)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#666666' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='700' font-size='28px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 1.2s'>\r
β 86\r
β </text>\r
β </g>\r
β <!-- Longest Streak label -->\r
β <g transform='translate(82.5,84)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#888888' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='14px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 1.3s'>\r
β Χ¨Χ¦Χ£ ΧΧΧ ΧΧ¨ΧΧ\r
β </text>\r
β </g>\r
β <!-- Longest Streak range -->\r
β <g transform='translate(82.5,114)'>\r
β <text x='0' y='32' stroke-width='0' text-anchor='middle' fill='#999999' stroke='none' font-family='"Segoe UI", Ubuntu, sans-serif' font-weight='400' font-size='12px' font-style='normal' style='opacity: 0; animation: fadein 0.5s linear forwards 1.4s'>\r
β <tspan x='0' dy='0'>19 ΧΧΧ¦ΧΧ³ 2016</tspan><tspan x='0' dy='16'>- 14 ΧΧΧ¨Χ₯ 2016</tspan>\r
β </text>\r
β </g>\r
β </g>\r
β </g>\r
β </svg>\r
β ' contains "<!-- Total Contributions big number -->
β <g transform='translate(412.5,48)'>".
β
β /mnt/github-readme-streak-stats/tests/RenderTest.php:245
β
FAILURES!
Tests: 46, Assertions: 5262, Failures: 1.
Script ./vendor/bin/phpunit --testdox tests handling the test event returned with error code 1