Skip to content
Shish edited this page Sep 8, 2024 · 13 revisions

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 -p 8000:8000 -v /my/hard/drive:/app/data 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 /app/data 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, 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

Build custom image

If you want to build your own image from source:

docker build -t shimmie2 .

And then:

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

Run with external database

SQLite typically handles tends of users and tens of thousands of images pretty easily, and keeps sysadmin work very minimal. If you're dealing with hundreds of users or hundreds of thousands of images, 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 docker-compose.yml file like so:

version: "3"
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:latest
    container_name: shimmie
    restart: unless-stopped
    environment:
      POSTGRES_HOST: sql
      POSTGRES_USER: shimmie
      POSTGRES_PASSWORD: shimmie
      INSTALL_DSN: "pgsql:user=shimmie;password=shimmie;host=sql;dbname=shimmie"
    ports:
      - 8001:8000
    volumes:
      - ./data:/app/data
Clone this wiki locally