A lightweight and secure Omeka S setup for Docker, built on Alpine Linux. This image is optimized for performance and size, making it an ideal choice for development and production environments.
Repository: https://github.com/erseco/alpine-omeka-s
- Lightweight: Built on the
erseco/alpine-php-webserverbase image for a minimal footprint (+/- 70MB). - Performant: Uses PHP-FPM with an
ondemandprocess manager to optimize resource usage. - Secure: Services run under a non-privileged user (
nobody). Logs are directed to the container's STDOUT. - Multi-Arch Support:
amd64,arm/v6,arm/v7,arm64,ppc64le,s390x. - Configurable: Easily configure the container using environment variables.
- Extensible: Automatically install themes and modules on startup.
- Simple & Transparent: Follows the KISS principle for easy understanding and customization.
Here is a minimal docker-compose.yml example to get you started:
---
services:
mariadb:
image: mariadb:lts
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=omeka_s
- MYSQL_DATABASE=omeka_s
- MYSQL_USER=omeka_s
- MYSQL_PASSWORD=omeka_s
volumes:
- mariadb_data:/var/lib/mysql
omeka-s:
image: erseco/alpine-omeka-s:latest
build:
context: .
restart: unless-stopped
ports:
- "8080:8080"
environment:
# Omeka S Installation Details
OMEKA_ADMIN_EMAIL: [email protected]
OMEKA_ADMIN_PASSWORD: PLEASE_CHANGEME
OMEKA_SITE_TITLE: "My Omeka S Site"
# Database Connection
DB_HOST: mariadb
DB_NAME: omeka_s
DB_USER: omeka_s
DB_PASSWORD: omeka_s
volumes:
- omeka_data:/var/www/html/volume
depends_on:
- mariadb
volumes:
mariadb_data: null
omeka_data: nullTo start the services, run:
docker compose upOnce the container is running, Omeka S will be installed and accessible at http://localhost:8080.
You can configure the container using the following environment variables in your docker-compose.yml file.
| Variable Name | Description | Default |
|---|---|---|
OMEKA_ADMIN_EMAIL |
Email for the primary administrator user. | null |
OMEKA_ADMIN_PASSWORD |
Password for the administrator. | null |
OMEKA_SITE_TITLE |
Public title of the Omeka S site. | null |
OMEKA_ADMIN_NAME |
Name of the administrator. | Site Administrator |
OMEKA_TIMEZONE |
Installation timezone (e.g., America/New_York). |
UTC |
OMEKA_LOCALE |
Interface locale for the installation. | en_US |
OMEKA_THEMES |
List of theme names | |
OMEKA_MODULES |
List of module names | |
OMEKA_CSV_IMPORT_FILE |
Path to a CSV file for initial data import. | null |
Note: The Omeka S installation will only run if OMEKA_ADMIN_EMAIL, OMEKA_ADMIN_PASSWORD, and OMEKA_SITE_TITLE are all set.
If you specify the OMEKA_CSV_IMPORT_FILE environment variable, the container will automatically import data from the given CSV file at startup.
Example:
environment:
OMEKA_CSV_IMPORT_FILE: /path/to/your/data.csvThe CSV file should be mounted into the container. For example, you can add this to your docker-compose.yml:
volumes:
- ./my-data.csv:/path/to/your/data.csvCSV Format Recommendations:
- Encoding: The file must be UTF-8 encoded.
- Headers: Use headers that match Omeka S properties, like
dcterms:title,dcterms:creator, etc., for automatic mapping. - For more details, refer to the official Omeka S CSV Import documentation.
| Variable Name | Description | Default |
|---|---|---|
DB_HOST |
Database host. | null |
DB_USER |
Database user. | null |
DB_PASSWORD |
Database password. | null |
DB_NAME |
Database name. | null |
DB_PORT |
Database port. | 3306 |
| Variable Name | Description | Default |
|---|---|---|
APPLICATION_ENV |
Set to development for debug mode and to enable OPcache timestamp validation (development mode). |
production |
OPCACHE_ENABLE |
Set to 0 to configure OPcache for development mode (enables timestamp validation). Note: OPcache remains enabled, but with development-friendly settings. |
1 (production mode) |
memory_limit |
PHP memory limit. | 512M |
upload_max_filesize |
Max size for uploaded files. | 128M |
post_max_size |
Max size of POST data. | 128M |
client_max_body_size |
Nginx max body size for uploads. | 128M |
max_execution_time |
PHP max execution time in seconds. | 300 |
| Variable Name | Description | Default |
|---|---|---|
| PRE_CONFIGURE_COMMANDS | Commands to run before starting the configuration | |
| POST_CONFIGURE_COMMANDS | Commands to run after finishing the configuration |
By default, the image uses production-optimized OPcache settings that do not validate file timestamps, which provides maximum performance but prevents code changes from being immediately visible (requires container restart).
For development workflows where you need code changes to be reflected immediately (e.g., when developing Omeka S modules with mounted volumes), you can enable OPcache timestamp validation using either of these methods:
Option 1: Using OPCACHE_ENABLE variable
environment:
OPCACHE_ENABLE: "0" # Configures OPcache for development (enables timestamp validation)Option 2: Using APPLICATION_ENV variable
environment:
APPLICATION_ENV: development # Auto-enables timestamp validationWhen either OPCACHE_ENABLE=0 or APPLICATION_ENV=development is set, the container will configure OPcache to validate file timestamps on every request (opcache.validate_timestamps=1 and opcache.revalidate_freq=0), allowing code changes to be immediately visible without restarting the container.
Production mode (default):
opcache.enable=1opcache.validate_timestamps=0(no timestamp checking for maximum performance)
Development mode:
opcache.enable=1opcache.validate_timestamps=1(checks files on every request)opcache.revalidate_freq=0(no delay in revalidation)
This image includes the Omeka-S-CLI tool, which simplifies the management of modules and themes. You can automatically install them by providing space-separated names in the OMEKA_MODULES and OMEKA_THEMES environment variables.
Example:
environment:
OMEKA_THEMES: "default"
OMEKA_MODULES: "Common EasyAdmin"For more advanced tasks, you can use omeka-s-cli directly within the container. This allows you to list, install, uninstall, and manage modules and themes.
Example Commands:
-
List all installed modules:
docker compose exec omeka-s omeka-s-cli module:list -
Install a new theme:
docker compose exec omeka-s omeka-s-cli theme:download foundation
After changing the version, rebuild the image:
docker compose build omeka-sIf you set OMEKA_CSV_IMPORT_FILE, the container will import data at startup using the CSVImport module and the bundled import_cli.php. The importer is configured as an upsert:
- If an item with the same title (
dcterms:title) already exists, it will be updated. - If not found, a new item will be created.
services:
omeka-s:
environment:
# ...
OMEKA_CSV_IMPORT_FILE: /data/sample_data.csv
volumes:
- ./data:/data:roThe entrypoint ensures the
CSVImportmodule is present and runs the import once on startup. The importer makes a temporary copy of your CSV before dispatching the job, so your original file is not deleted.
- Encoding: UTF-8 (no BOM).
- Delimiter:
,(comma). - Quote:
"(double quote). - Escape:
\(backslash). - Header row: required.
Minimum headers supported by the default mapping included in this image:
| Column Name | Required | Purpose |
|---|---|---|
dcterms:title |
Yes | Used as the identifier for upsert (update vs create). |
dcterms:creator |
No | Creator (example mapping). |
dcterms:description |
No | Description (example mapping). |
media_url |
No | A direct URL to a media file; ingested with the url ingester. |
Upsert behavior:
- Action:
update - Identifier property:
dcterms:title - If no match by title:
create
If multiple items share the same title, the module’s default lookup can update the first match. Prefer unique titles for deterministic results.
dcterms:title,dcterms:creator,dcterms:description,media_url
Eiffel Tower,Gustave Eiffel,"A wrought-iron lattice tower in Paris, France.",https://upload.wikimedia.org/wikipedia/commons/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg
Mona Lisa,Leonardo da Vinci,"A portrait painting by the Italian Renaissance artist.",https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/800px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg
Statue of Liberty,Frédéric Auguste Bartholdi,"A neoclassical sculpture on Liberty Island, New York Harbor.",https://upload.wikimedia.org/wikipedia/commons/a/a1/Statue_of_Liberty_7.jpg-
Loads Omeka S and the
CSVImportmodule. -
Authenticates using the admin configured during installation.
-
Reads the header row to build the column list.
-
Applies a built-in mapping:
dcterms:title→ property id1dcterms:creator→ property id2dcterms:description→ property id4media_url→ ingesterurl
-
Dispatches
CSVImport\Job\Importwith:action=updateidentifier_property=dcterms:titleaction_unidentified=create- batches of
rows_by_batch=20
If you need to run commands as root inside the container (e.g., to install system packages), use docker compose exec:
docker compose exec --user root omeka-s sh