Browse Source

Omeka Classic Docker

master
Siroco 9 months ago
commit
8572fc6a67
Signed by: siroco
GPG Key ID: 1324098302A514B0
  1. 46
      Dockerfile
  2. 10
      README.md
  3. 323
      config.ini
  4. 19
      db.ini
  5. 40
      docker-compose.yml
  6. 61
      nginx.conf
  7. 135
      php.ini
  8. 20
      www.conf

46
Dockerfile

@ -0,0 +1,46 @@
FROM registry.sindominio.net/debian as builder
# Install dependencies
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y git imagemagick wget unzip
RUN apt-get update && \
apt-get -qy install \
php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip php-imagick\
ghostscript wget sudo curl openssl imagemagick && \
apt-get clean
RUN useradd omeka -d /omeka/
RUN mkdir /run/php/
RUN mkdir logs
# Install omeka
WORKDIR omeka
RUN chown omeka:omeka /omeka
USER omeka
RUN git clone https://github.com/omeka/Omeka.git
RUN chmod 775 Omeka
WORKDIR /omeka/Omeka
RUN touch .htaccess
USER root
RUN mkdir /var/log/php
RUN chown -R omeka:omeka /var/log/php
EXPOSE 9000
VOLUME /omeka/
CMD ["/usr/sbin/php-fpm7.4","--nodaemonize"]]

10
README.md

@ -0,0 +1,10 @@
# Omeka Classic Docker Image
Omeka Classic is a web publishing platform for sharing digital collections and creating media-rich online exhibits.
https://omeka.org/classic/
## Links
* https://www.nginx.com/resources/wiki/start/topics/recipes/omeka/
* https://websiteforstudents.com/setup-omeka-classic-cms-on-ubuntu-16-04-17-10-18-04-with-nginx-mariadb-and-php-7-2-fpm/

323
config.ini

@ -0,0 +1,323 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Site Configuration File ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Lower-level settings for Omeka are defined here.
;
; The default settings should be correct for most Omeka users, but some
; setups may require some changes. People who are developing for or
; debugging Omeka may also change some of these settings.
[site]
;;;;;;;;;;;;;;;;
; Localization ;
;;;;;;;;;;;;;;;;
; locale.name
; The locale identifier used for translating and displaying Omeka.
; default: none
;
; The locale controls what language Omeka will be displayed in, and
; also how dates and other locale-sensitive data will be displayed.
;
; The locale identifier should be a valid ISO 639 language code,
; and optionally a valid ISO 3166-1 locale code.
; (Examples: "es" for Spanish, "en_US" for US English.)
;
; To enable translations, the identifier must also have a
; corresponding .mo file in the application/languages directory.
locale.name = ""
;;;;;;;;;;;;;
; Debugging ;
;;;;;;;;;;;;;
; debug.exceptions
; Throw exceptions for bad URLs.
; default: false
;
; This should only be enabled when debugging or developing for Omeka.
debug.exceptions = false
; debug.request
; Dump data about each web request to the browser.
; default: false
;
; The request data shows what routes and variables Omeka has parsed from
; each request.
debug.request = false
; debug.profileDb
; Enable the query profiler.
; default: false
;
; This will show metadata about the queries that were executed during
; each request.
debug.profileDb = false
; debug.email
; Send all log messages to an email address.
; default: ""
;
; Anything that would be logged will also be emailed to this address.
; If left blank, this feature is disabled.
debug.email = ""
; debug.emailLogPriority
; Apply a priority filter to emailed log messages.
; default: Zend_Log::ERR
;
; If an address has been set for debug.email, this setting filters the
; messages to only those of the given priority or higher.
debug.emailLogPriority = Zend_Log::ERR
;;;;;;;;;;;
; Logging ;
;;;;;;;;;;;
; log.errors
; Log errors and other information.
; default: false
;
; Errors, exceptions, and other messages will be logged to
; application/logs/errors.log (this file must be writable by the web
; server if logging is enabled).
log.errors = false
; log.priority
; The minimum priority level of messages that should be logged.
; When developing/debugging, use Zend_Log::DEBUG for debug() to work. This will record everything.
; default: Zend_Log::WARN (Logs warnings and above)
log.priority = Zend_Log::WARN
; log.sql
; Log SQL statements.
; default: false
;
; All SQL statements executed by Omeka will be included in Omeka's
; error log.
log.sql = false
;;;;;;;;;;;;
; Sessions ;
;;;;;;;;;;;;
;
; Omeka uses Zend Framework's session handling. A full list of
; available session configuration options can be found here:
; https://framework.zend.com/manual/1.12/en/zend.session.global_session_management.html
;
; Some options that are often useful for Omeka sites are included here.
; session.name
; Sets the name used for the Omeka session cookie.
; default: ""
;
; If left blank, Omeka will automatically select a unique session name.
session.name = ""
; session.saveHandler
; Determines how session data will be saved.
; default: no setting (uses the database for saving session data)
;
; Sessions are now stored in the database by default. To revert to the
; older method of storing session data in the filesystem, uncomment the
; following line.
; session.saveHandler = ""
;;;;;;;;;
; Theme ;
;;;;;;;;;
; theme.useInternalAssets
; Whether Omeka should use locally-stored asset files.
; default: false
;
; Omeka includes some asset files from external sources, such as Google by
; default. Set this to true if the Omeka installation does not have
; web access, and Omeka will instead serve local copies of these files.
theme.useInternalAssets = false
;;;;;;;;;;;;;;;;;;;;;;
; Background Scripts ;
;;;;;;;;;;;;;;;;;;;;;;
; background.php.path
; Path to PHP-CLI for running background processes.
; default: ""
;
; If left blank, Omeka will try to autodetect the right path. Set this
; to override the autodetected PHP path.
background.php.path = ""
; jobs.dispatcher
; How Omeka "jobs" will be executed.
; default: "Omeka_Job_Dispatcher_Adapter_Synchronous"
;
; Newer Omeka features and plugins use this setting to determine how
; long-running jobs will be run.
;
; The default setting should work for all installations, but may
; time out for longer jobs. On systems where the older PHP background
; processes worked, the BackgroundProcess adapter can be used instead
; of the Synchronous one.
jobs.dispatcher.default = "Omeka_Job_Dispatcher_Adapter_Synchronous"
jobs.dispatcher.longRunning = "Omeka_Job_Dispatcher_Adapter_BackgroundProcess"
;;;;;;;;
; Mail ;
;;;;;;;;
;
; For more info, see Zend Framework documentation on Zend_Mail:
; http://framework.zend.com/manual/en/zend.mail.html
; mail.transport.type
; The system Omeka will use to send email messages.
; default: "Sendmail"
;
; The default is to send mail using PHP's built-in mail() function.
mail.transport.type = "Sendmail"
; Uncomment some of the following lines (and comment the above line)
; to switch to SMTP for sending mail through Omeka. Your configuration
; may not require all of the options listed.
;
; mail.transport.type = "Smtp"
; mail.transport.host = ""
; mail.transport.port = ### ; Port number, if applicable.
; mail.transport.name = "" ; Local client hostname, e.g. "localhost"
; mail.transport.auth = "login" ; For authentication, if required.
; mail.transport.username = ""
; mail.transport.password = ""
; mail.transport.ssl = "" ; For SSL support, set to "ssl" or "tls"
; mail.force_from
; Force all outgoing emails to have the configured From address
; mail.force_from = ""
; mail.force_from_name
; If mail.force_from is set, use the configured friendly name in From
; mail.force_from_name = ""
;;;;;;;;;;;
; Storage ;
;;;;;;;;;;;
; Sample S3 cloud storage configuration
;
; The accessKeyId, secretAccessKey, and bucket options are all required.
; If the expiration option is set, files will be uploaded with "private"
; access, and Omeka will generate URLs that are only valid for a limited
; time. If the expiration option is missing or left commented out,
; uploaded files will always be publicly readable. Leave the forceSSL
; option commented out unless site is served over HTTPS-only *and* the
; the web browser is issuing mixed-content warnings.
;
; storage.adapter = "Omeka_Storage_Adapter_ZendS3"
; storage.adapterOptions.accessKeyId =
; storage.adapterOptions.secretAccessKey =
; storage.adapterOptions.bucket =
; storage.adapterOptions.expiration = 10 ; URL expiration time (in minutes)
; storage.adapterOptions.endpoint = ; Custom S3 endpoint (optional)
; storage.adapterOptions.forceSSL = 1 ; Boolean value (optional)
;;;;;;;;;;;;
; Security ;
;;;;;;;;;;;;
; ssl
; Secure Socket Layer support for Omeka.
; default: none
;
; Ensure that your server is properly configured before enabling this
; setting. Choose one of the following:
;
; "logins"
; Force SSL for login forms and login form submissions.
;
; "sessions"
; Force SSL for all authenticated users to protect sessions. Includes
; login forms.
;
; "always"
; Force SSL on across the entire site.
;
; ssl = "always"
; sslTrustProxy
; Whether the "ssl" setting should respect X-Forwarded-Proto headers.
; default: false
;
; This only has an effect if the "ssl" setting is enabled.
; Setting to true will cause Omeka to treat requests with the X-Fowarded-Proto
; header set to "https" as secure (meaning they won't be redirected).
;
; sslTrustProxy = true
;;;;;;;;;;
; Upload ;
;;;;;;;;;;
; upload.maxFileSize
; Set the maximum file upload size.
; default: 10M
;
; Uncomment the following line to set the maximum file upload size. This
; configuration will not exceed the maximum beyond what is set in the
; 'post_max_size' or 'upload_max_filesize' core php.ini directives.
;
;upload.maxFileSize = "10M"
;;;;;;;;;;;;;;;;;;;;;
; Derivative Images ;
;;;;;;;;;;;;;;;;;;;;;
; fileDerivatives.strategy
; Controls what method Omeka uses to create derivative images.
; default: Omeka_File_Derivative_Strategy_ExternalImageMagick
;
; The built-in strategies are ExternalImageMagick (the old default), Imagick
; (requires PECL ext/imagick), and GD (generally installed by default with PHP,
; but handles fewer formats). Others can be added by plugins.
;
;fileDerivatives.strategy = "Omeka_File_Derivative_Strategy_ExternalImageMagick"
; fileDerivatives.strategyOptions
; Specific settings for the configured derivative strategy.
;
; Subkeys to this entry specify each option.
;
; fileDerivatives.strategyOptions.page = "0"
; fileDerivatives.strategyOptions.gravity = "center"
; fileDerivatives.strategyOptions.autoOrient = true
; fileDerivatives.typeWhitelist[]
; If set, Omeka will only attempt to create derivatives for files with the
; given MIME types.
;
; This entry can be specified multiple times, once for each type in the list.
;
;fileDerivatives.typeWhitelist[] = "image/jpeg"
; fileDerivatives.typeBlacklist[]
; If set, Omeka will not attempt to create derivatives for files with the
; given MIME types.
;
; Both this blacklist and the whitelist can be set at the same time, but the
; whitelist will control.
;
; This entry can be specified multiple times, once for each type in the list.
;
;fileDerivatives.typeBlacklist[] = "image/jpeg"
;;;;;;;;;;;
; Updates ;
;;;;;;;;;;;
;
; versionNotifications
; Whether Omeka should prompt admin users about updates to plugins and themes
; default: true
;
; versionNotifications = false

19
db.ini

@ -0,0 +1,19 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Database Configuration File ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Omeka requires MySQL 5 or newer.
;
; To configure your database, replace the X's with your specific
; settings. If you're unsure about your database information, ask
; your server administrator, or consult the documentation at
; <http://omeka.org/codex/Database_Configuration_File>.
[database]
host = "db"
username = "USERNAME"
password = "PASSWORD"
dbname = "DATABASE"
prefix = "omeka_"
charset = "utf8"
;port = ""

40
docker-compose.yml

@ -0,0 +1,40 @@
version: '3'
volumes:
data:
dbdata:
services:
db:
image: mariadb
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- dbdata:/var/lib/mysql
environment:
MYSQL_PASSWORD: PASSWORD
MYSQL_USER: USERNAME
MYSQL_DATABASE: DATABASE
MARIADB_RANDOM_ROOT_PASSWORD: 1
omeka:
build: .
restart: always
links:
- db
volumes:
- data:/omeka
- ./db.ini:/omeka/Omeka/db.ini
- ./config.ini:/omeka/Omeka/application/config/config.ini
- ./www.conf:/etc/php/7.4/fpm/pool.d/www.conf:ro
nginx:
image: registry.sindominio.net/nginx
restart: always
links:
- omeka
ports:
- "8883:80"
volumes:
- data:/omeka
- ./nginx.conf:/etc/nginx/sites-available/default:ro

61
nginx.conf

@ -0,0 +1,61 @@
server {
listen 80;
server_name default_server;
root /omeka/Omeka;
index index.php index.html index.htm;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \..*/.*\.php$ {
return 403;
}
location / {
try_files $uri /index.php?$args;
}
location /admin {
try_files $uri /admin/index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass omeka:9000;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location /install {
try_files $uri /install/install.php?$args;
# This is an odd way to check that rewrites work...
location ~* /install/check-mod-rewrite([^/]*)\.html$ {
rewrite ^ /install/mod-rewrite.php?enabled=true;
}
}
access_log /var/log/nginx/omeka.access.log;
error_log /var/log/nginx/omeka.error.log;
}

135
php.ini

@ -0,0 +1,135 @@
[PHP]
expose_php = Off
max_input_time = 120
max_input_vars = 3000
max_execution_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
report_memleaks = On
track_errors = Off
error_log = /var/log/error.php-fpm.log
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[imap]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = -1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]

20
www.conf

@ -0,0 +1,20 @@
[omeka]
user = omeka
group = omeka
listen = 9000
listen.owner = omeka
listen.group = omeka
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
access.log = /var/log/php/$pool.access.log
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/php/$pool.error.log
php_admin_flag[log_errors] = on
Loading…
Cancel
Save