versatiles-org / versatiles-docker

24 stars 1 forks source link

Versatiles Frontend Docker Container Crashes Immediately on Startup #12

Closed FabianRechsteiner closed 1 month ago

FabianRechsteiner commented 1 month ago

Hello,

I attempted to start the Docker image versatiles/versatiles-frontend:v0.12.6 using Docker Compose. Unfortunately, it crashes immediately and stops.

Here is the compose.yaml file:

---
services:
  versatiles:
    image: versatiles/versatiles-frontend:v0.12.6 # https://hub.docker.com/r/versatiles/versatiles-frontend
    container_name: versatiles
    volumes:
      - ./app:/app
    ports:
     - 8100:8080
    # restart: always
    networks:
      - nginx

networks:
  nginx:
    name: nginx
    external: true

What is wrong with this configuration?

MichaelKreil commented 1 month ago

The current Docker images contain the versatiles binary and the frontend assets, but they do not execute anything by default. I haven't defined a CMD or ENTRYPOINT yet because I'm still considering the best approach to handle different map sources.

At the moment, the container requires you to specify a command manually. (Also, note that if you mount the /app directory, it will overwrite the versatiles binary and frontend.br.tar that are included in the image.)

Here is an example of how you can manually define the command in your docker-compose.yaml to run the versatiles server:

services:
  versatiles:
    image: versatiles/versatiles-frontend:alpine
    volumes:
      - ../tiles/:/data
    command: versatiles serve -s frontend.br.tar /data/osm.versatiles

But as I said, I would be very happy about suggestions or improvements regarding the setup of the Docker containers or the documentation.

FabianRechsteiner commented 1 month ago

Thank you for the information!

I already have my own vector tile server running and have created a JSON file for it: https://vectormap.ch/vectormap_bbox_av.json.

You can also view it here: https://vectormap.ch/BaseMapAV.

Is it possible to use the Versatiles frontend to visualize my own vector tiles? Or is the frontend strictly limited to the osm.versatiles data?

MichaelKreil commented 1 month ago

You can have a look at the frontend code: https://github.com/versatiles-org/versatiles-frontend/releases/latest/download/frontend.tar.gz It is basically just MapLibre GL JS, but we have added fonts, sprites, styles and a bit of HTML - so basically the same thing you did on vectormap.ch. But we are trying to make it more reusable for frontend developers.

The frontend should not be limited to displaying only Shortbread vector tiles. But that's what we're focusing on first. Later we will add raster tiles, hill shading, elevation data and so on. Some functionality is already implemented, but only rudimentary.