github-readme-streak-stats icon indicating copy to clipboard operation
github-readme-streak-stats copied to clipboard

Feature request: Docker image

Open NorskNoobing opened this issue 2 years ago β€’ 1 comments

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?

NorskNoobing avatar Nov 17 '23 17:11 NorskNoobing

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. image

Then I tried stopping the container, and I got the error Unable to connect. image

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

NorskNoobing avatar Nov 22 '23 01:11 NorskNoobing