That's totally possible, I've done it myself. However, it takes a while to do everything.
1. Generate MBTiles
First of all, I'd suggest you start taking a look in the Github repo of OpenMapTiles: https://github.com/openmaptiles/openmaptiles
To generate an MBTiles file, for a country is quite manageable to do in your own computer. And basically you can do so by executing the main script with the name of the country as a parameter. Like this:
./quickstart.sh portugal
After the script creates a Docker machine, downloads the OpenStreetMap data for the country, processes it, and generates the MBTiles file, then you'll be done.
For me, with an average computer, for countries like Spain or Portugal, it takes about 4-12 hours to do so. But it really depends on the country. Norway takes forever (about 4 days), I believe due to its very long coastline.
If you want an MBTiles file that will work for the whole planet, then you need a more powerful computer, that specially has a big SSD and lots of RAM. Between 32 and 64 GB of RAM and 250-300 GB of SSD.
2. Set up a tile server
After that, you can use this project https://github.com/urbica/tessella to run your own tile server to be consumed form a website or mobile app.
The resources of the server will depend on the size of the MBTiles file you want to use in the server.
3. Enable contour lines
This is possible too, but a bit more trickier. I'd suggest you use Maptiler as a service for this.
Whenever I achieve this matter, I'll go back to you with the information.
If the tiles you generate don't contain the contour / elevation data, then styles won't help. The tiles from OpenMapTiles do not have the contours inside.
4. Display GPS tracks
This is possible as well. What technology you want to use here? Is it web? Then Leaflet is your friend. If it's mobile app, then you can give it a try to VTM: https://github.com/mapsforge/vtm or to Carto.