Docker - shish/shimmie2 GitHub Wiki

If you just want to run shimmie inside docker, there's a pre-built image in dockerhub - shish2k/shimmie2 - which can be used like:

docker run --rm -p 8000:8000 -v /my/hard/drive:/app/data -t shish2k/shimmie2

With the use of SQLite as a database, this should have everything you need to run a moderately-sized site in a self-contained way, all persistent data living in the docker host's /my/hard/drive directory.

There are various options settable with environment variables:

  • UID=1000 / GID=1000 - which user ID to run as
  • INSTALL_DSN - specify a data source to install into, to skip the installer screen, eg
    • -e INSTALL_DSN="pgsql:user=shimmie;password=6y5erdfg;host=127.0.0.1;dbname=shimmie"
  • PHP_INI_* set php.ini variables (using _DOT_ because environment variables can't have dots), eg
    • PHP_INI_UPLOAD_MAX_FILESIZE=50M - set the web-server level upload size limits (Shimmie's own filesize limits can't go any higher than whatever this is set to)
    • PHP_INI_MAX_FILE_UPLOADS=100 - set the web-server level limit on number of files
    • PHP_INI_OPCACHE_DOT_JIT=tracing - enable JIT

Build custom image

If you want to build your own image from source:

docker build -t shimmie2 .

And then:

docker run --rm -p 8000:8000 -v /my/hard/drive:/app/data -t shimmie2

Adding custom themes

If you have a custom theme in /my/folder/with/theme, you can connect that folder to docker like

-v /my/folder/with/theme:/app/themes/mytheme

and then mytheme should show up as an option in the Board Config

Eg

docker run -p 8000:8000 -v /home/shish/website/database:/app/data -v /home/shish/website/theme:/app/themes/mytheme shish2k/shimmie2

Adding custom extensions

Similar to themes, eg

-v /my/folder/with/extension:/app/ext/myext

And then myext should show up in the Extension Manager page

Run with external database

SQLite typically handles tens of users and thousands of posts pretty easily, and keeps sysadmin work very minimal. If you're dealing with thousands of users or millions of posts, you might want a more heavyweight database, in which case we'd recommend using postgresql. To run shimmie and postgres as a pair, you can use docker compose with a compose.yml file like so:

services:
  sql:
    image: postgres:15-alpine
    container_name: shimmie-sql
    restart: unless-stopped
    user: 1000:1000
    environment:
      POSTGRES_USER: shimmie
      POSTGRES_PASSWORD: shimmie
    volumes:
      - ./db:/var/lib/postgresql/data
  shimmie:
    image: shish2k/shimmie2:2
    container_name: shimmie
    restart: unless-stopped
    tty: true
    environment:
      POSTGRES_HOST: sql
      POSTGRES_USER: shimmie
      POSTGRES_PASSWORD: shimmie
      INSTALL_DSN: "pgsql:user=shimmie;password=shimmie;host=sql;dbname=shimmie"
    ports:
      - 8000:8000
    volumes:
      - ./data:/app/data
      - ./theme:/app/themes/mysitetheme
      - ./ext:/app/ext/mysiteext