szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.65k stars 163 forks source link

Docker: Provide sample docker-compose.yml, especially on hub.docker.com #135

Closed diamondsw closed 1 year ago

diamondsw commented 1 year ago

Right now only a partial compose file is provided, and it does not show how to use command-line options. I recommend a better example that matches the command-line examples, for instance:

version: "3"
services:
  microbin:
    image: danielszabo99/microbin:latest
    container_name: microbin
    restart: unless-stopped
    command: >
      --public-path 'https://myserver.net'
      --highlightsyntax
      --editable
    ports:
     - '8080:8080'
    volumes:
     - ./data:/app/pasta_data
ItsNoted commented 1 year ago

You can use this one I made too.

services:
  paste:
    image: danielszabo99/microbin
    container_name: microbin
    restart: always
    environment:
     - MICROBIN_PRIVATE=true
     - MICROBIN_PUBLIC_PATH=https://website.com #remove this if running locally. cant use QR or copy links if not using.
     - MICROBIN_EDITABLE=true
     - MICROBIN_ENABLE_BURN_AFTER=true
     - MICROBIN_QR=true
     - MICROBIN_HIGHLIGHTSYNTAX=true
     - MICROBIN_TITLE=Microbin
     - MICROBIN_HIDE_FOOTER=true
    ports:
     - "8065:8080"
    volumes:
     - /docker/microbin:/my/microbin
     - /docker/microbin/data:/app/pasta_data #mounting database.json for persistent DB.

You can see more environment variables here.

langbein-daniel commented 1 year ago

@ItsNoted you provided the MICROBIN_QR variable twice, so I would remove the second declaration. And what is the /docker/microbin:/my/microbin volume for?

szabodanika commented 1 year ago

This is now available: https://github.com/szabodanika/microbin/blob/664c4495e0259fd9931f80493f821832c0446e1c/compose.yaml

diamondsw commented 1 year ago

That's not remotely a valid compose file. It doesn't have the correct name, doesn't include the version declaration, and passes all the environment variables into the container from the host... but never defines them.

szabodanika commented 1 year ago

compose.yaml is the recommended name for the docker compose file. The same docs page states that version declaration is optional. As for the environment variables, there is a .env file available that you defines these, you have to pass that to the container: docker compose --env-file .env up --detach