speedtest-tracker icon indicating copy to clipboard operation
speedtest-tracker copied to clipboard

๐Ÿ‹ LinuxServer.io Docker image now available!

Open alexjustesen opened this issue 4 months ago โ€ข 46 comments

๐Ÿ‹ LinuxServer image now available!

I recently wrapped up testing (#837) with @thespad and the fantastic people over at @LinuxServer have published their Speedtest Tracker image!

There are a bunch of benefits to the new image but the highlights are:

  1. 3-4x faster page loads, depending on the host device.
  2. The image is HALF the size, down from ~298MB to ~154MB. This is largely due to a switch to an Alpine Linux base from Ubuntu.
  3. Directory and file permissions are now set correctly, this means I'm bringing back sqlite as the default database on new installs.
  4. Less on my plate allowing me to spend more time on core application features.

๐Ÿ–ผ๏ธ Using the new image

Most importantly the new image is a drop-in replacement to the old one. To switch all you have to do is replace the image:

image: lscr.io/linuxserver/speedtest-tracker:latest

or with a specific version:

image: lscr.io/linuxserver/speedtest-tracker:0.18.6

Further image documentation and supported architectures can be found on their GitHub repo.

๐Ÿงช Verified running on

My home lab is limited but verified working on the following systems:

  • Synology NAS (DS920+)
  • Unraid NAS (using the template)
  • RPI 4b+ Docker Swarm node

๐Ÿ“ƒ To-dos

I have some outstanding tasks that I still need to do, below is a list that'll get checked off over time as I roll through the rest of the updates.

  • [x] Update the docs
  • [ ] Revert back to sqlite as the default database for new installs
  • [x] ~Revert back to file as the default cache driver for new installs~ Keeping database as the default cache driver as this aligns with Laravel 11 standard.
  • [x] ~Update the Unraid plugin template~ lsio added theirs to Unraid CA
  • [x] #1379
  • [ ] Add LSIO image to the CI/CD pipeline
  • [ ] Stop building my own image

alexjustesen avatar Feb 09 '24 13:02 alexjustesen

@alexjustesen when using the LSIO Docker container, I get the following error:

[2024-02-19 17:37:16] production.ERROR: SQLSTATE[08006] [7] connection to server at "postgres.domain" (100.64.x.x), port 5430 failed: could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied

Are you able to confirm that this isn't due to a recent change in the underlying image, and if so, is there a way to specify sslmode=no-verify to allow an SSL connection without certificates? Unsure if this should be directed to this project or the LSIO image.

The directory /root/.postgresql doesn't exist in either Docker image as far as I can tell.

mmomjian avatar Feb 19 '24 17:02 mmomjian

Not tested but you should be able to set it with DB_SSLMODE, that said it looks like the deault is already prefer which shouldn't try and verify the certs.

thespad avatar Feb 19 '24 17:02 thespad

I just tried DB_SSLMODE=require and DB_SSLMODE=no-verify, same issue. I opened an issue on the LSIO repo as well with more details at link. Cheers!

mmomjian avatar Feb 19 '24 17:02 mmomjian

@alexjustesen @thespad the LSIO image has a new key path due to the (much appreciated) switch to Nginx and faster HTTP response. Perhaps this can be documented somewhere? I can already tell that the Web UI is much faster to respond!

/etc/ssl/web/ssl.crt -> /config/keys/cert.crt

/etc/ssl/web/ssl.key -> /config/keys/cert.key

The solution for the Postgres SSL error is to specify HOME=/config in Docker compose.

mmomjian avatar Feb 19 '24 18:02 mmomjian

Is SQLite the default already in the latest LSCR image? I am planning to rebuild my container today since 0.16 made a mess of things and I don't feel like fixing database issues.

If SQLite isn't the default yet, what's the easiest way to roll out a new container based on this with a SQLite backend?

luckman212 avatar Feb 19 '24 18:02 luckman212

Is SQLite the default already in the latest LSCR image? I am planning to rebuild my container today since 0.16 made a mess of things and I don't feel like fixing database issues.

If SQLite isn't the default yet, what's the easiest way to roll out a new container based on this with a SQLite backend?

Not yet, but I did update the docs for setting sqlite as your database.

Only DB_ variable you need is DB_CONNECTION and set it to sqlite and then follow the install steps for creating the DB file.

alexjustesen avatar Feb 19 '24 18:02 alexjustesen

sqlite is the default in so much as it's in our example compose/run because it's the simplest to set up (and it's what our CI tests use).

So if you just copy/paste them as-is you'll get sqlite.

thespad avatar Feb 19 '24 19:02 thespad

sqlite is the default in so much as it's in our example compose/run because it's the simplest to set up (and it's what our CI tests use).

So if you just copy/paste them as-is you'll get sqlite.

He's probably talking about https://docs.speedtest-tracker.dev/getting-started/installation/installation, which I can't update because GitBook is throwing an error when adding a new tab ๐Ÿคฆโ€โ™‚๏ธ

alexjustesen avatar Feb 19 '24 20:02 alexjustesen

I have this error with docker compose on ubuntu:

02/19/2024
04:10:03 PM
In Connection.php line 829:
02/19/2024
04:10:03 PM
                                                                               
02/19/2024
04:10:03 PM
  SQLSTATE[HY000]: General error: 1 there is already another table or index w  
02/19/2024
04:10:03 PM
  ith this name: results_bad_json (Connection: sqlite, SQL: alter table "resu  
02/19/2024
04:10:03 PM
  lts" rename to "results_bad_json")          

vdrover avatar Feb 19 '24 22:02 vdrover

@alexjustesen I solved my issue. Remember CACHE_DRIVER="file" as the workaround for a a previous bug? I had to remove that with v0.16.x, regardless of the image source.

vdrover avatar Feb 19 '24 22:02 vdrover

Follow-up #2: after migrating to the new image, I had to reset my cron schedule.

vdrover avatar Feb 19 '24 22:02 vdrover

Follow-up #2: after migrating to the new image, I had to reset my cron schedule.

This is intentional ๐Ÿ‘

alexjustesen avatar Feb 19 '24 22:02 alexjustesen

This is intentional ๐Ÿ‘

Please add to docs if you have not already. And thanks for all your hard work!

vdrover avatar Feb 19 '24 22:02 vdrover

This is intentional ๐Ÿ‘

Please add to docs if you have not already. And thanks for all your hard work!

Checkout the FAQ attached to the release should you have any questions. This details out the breaking changes.

alexjustesen avatar Feb 19 '24 22:02 alexjustesen

Switched to this image, initial page load is way faster. Thanks for the great work!

Churator avatar Feb 20 '24 06:02 Churator

Just wanted to share, I set this up today. The only thing i really found missing was mention of REDIS_HOST in the docs (perhaps I overlooked it)

  speedtest-tracker:
    <<: *lsioint
    image: lscr.io/linuxserver/speedtest-tracker:latest
    container_name: speedtest-tracker
    depends_on:
      redis:
        condition: service_started
      pgsql:
        condition: service_healthy
    environment:
      <<: *lsio
      DB_CONNECTION: pgsql
      APP_KEY: ${SPEEDTESTAPIKEY}
      DB_HOST: pgsql
      DB_PORT: 5432
      DB_DATABASE: speedtest
      DB_USERNAME: ${SPEEDTESTDBUSER}
      DB_PASSWORD: ${SPEEDTESTDBPW}
      CACHE_DRIVER: redis
      REDIS_HOST: redis
    volumes:
      - ${CONFDIR}/speedtest:/config
      - ${TIME}:${TIME}:ro

Things are working very well for me.

drizuid avatar Feb 20 '24 15:02 drizuid

Redis is supported at the framework level if you want to use it as the cache or queue drivers but haven't included it here in the docs to keep it simple.

Definitely a more "advanced" feature.

alexjustesen avatar Feb 20 '24 16:02 alexjustesen

Worked flawlessly. Keep up the great work!๐Ÿš€

ArthurHuyghe avatar Feb 22 '24 19:02 ArthurHuyghe

Just curious... what's the purpose of this? If I'm understanding correctly, this means you'll stop putting our the app/container here and we should consider linuxserver as the new main Speedtest Tracker?

Sorry just wondering!

devanteweary avatar Feb 23 '24 18:02 devanteweary

Just curious... what's the purpose of this? If I'm understanding correctly, this means you'll stop putting our the app/container here and we should consider linuxserver as the new main Speedtest Tracker?

Sorry just wondering!

https://github.com/alexjustesen/speedtest-tracker/issues/1224

think this will answer at least one of your questions.

hansenc0705 avatar Feb 23 '24 18:02 hansenc0705

Just curious... what's the purpose of this? If I'm understanding correctly, this means you'll stop putting our the app/container here and we should consider linuxserver as the new main Speedtest Tracker?

Sorry just wondering!

I'll still be building the application, they're just building the docker image going forward.

Gives me time and sanity.

alexjustesen avatar Feb 24 '24 00:02 alexjustesen

Just curious... what's the purpose of this? If I'm understanding correctly, this means you'll stop putting our the app/container here and we should consider linuxserver as the new main Speedtest Tracker? Sorry just wondering!

I'll still be building the application, they're just building the docker image going forward.

Gives me time and sanity.

Gotcha.

Still learning all this and so I just thought the Docker container was part of the program. Thanks for responding @alexjustesen !

devanteweary avatar Feb 24 '24 00:02 devanteweary

Anyway to get the results back after redoing with new image?

grantdray avatar Feb 26 '24 03:02 grantdray

Go to the results page and click the migrate button.

vdrover avatar Feb 26 '24 07:02 vdrover

Go to the results page and click the migrate button.

I thought so too but it wasn't shown there.

grantdray avatar Feb 27 '24 02:02 grantdray

I thought so too but it wasn't shown there.

The change wasn't tied to the switch to LSIO's image, just coincidence it happened at the same time. v0.16.0 is where the data quality change was made https://github.com/alexjustesen/speedtest-tracker/releases/tag/v0.16.0.

alexjustesen avatar Feb 27 '24 02:02 alexjustesen

Hello @alexjustesen, Thanks for the project and I'm happy to donate to it. How can I install the project on my Ubuntu server without using Docker? Thank you.

snetgh avatar Mar 30 '24 07:03 snetgh

Hello @alexjustesen, Thanks for the project and I'm happy to donate to it. How can I install the project on my Ubuntu server without using Docker? Thank you.

I'm not current supporting installs other than using the images but if you're familiar with the Laravel framework you could figure it out via their docs.

alexjustesen avatar Mar 30 '24 14:03 alexjustesen

In case anyone else has the 500 error when switching to the linuxserver version directly.

https://github.com/linuxserver/docker-speedtest-tracker/issues/9#issuecomment-2060121995

Manichee avatar Apr 17 '24 00:04 Manichee

Worked first try for me - good effort! :)

jamess60 avatar Apr 17 '24 23:04 jamess60