Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
178 lines (172 sloc) 7 KB
# docker-elabftw configuration file
# use : "docker-compose up -d" to start containers
# https://hub.docker.com/r/elabftw/elabimg/
# https://www.elabftw.net
version: '3'
# our first container is nginx + php-fpm + elabftw
services:
web:
# the latest tag points to the latest stable version
# use the next tag to use alpha/beta version
# use a specific version to pin the image
# example: elabftw/elabimg:3.5.0
image: elabftw/elabimg:latest
restart: always
# comment this out if you use several containers with redis
container_name: elabftw
# drop some capabilities
cap_drop:
- SYS_ADMIN
- AUDIT_WRITE
- MKNOD
- SYS_CHROOT
- SETFCAP
- NET_RAW
- SYS_PTRACE
environment:
# name of the MySQL server (by default "mysql" the name of the mysql container)
# you probably don't need to modify this value
- DB_HOST=mysql
# port on which the MySQL server is listening
# you probably don't need to modify this value
- DB_PORT=3306
# name of the MySQL database
# you probably don't need to modify this value
- DB_NAME=elabftw
# MySQL user with write access to the previously named database
# you probably don't need to modify this value
- DB_USER=elabftw
# MySQL password; a random password has been generated for you but feel free to change it if needed
- DB_PASSWORD=secr3t
# Mysql Cert path: you only need this if you connect to a mysql server with tls
# Use a volume that points to /mysql-cert in the container
#- DB_CERT_PATH=/mysql-cert/cert.pem
# The secret key is used for encrypting the SMTP password
# A random one has been generated for you, if you wish to change it you can
# get your secret key from https://demo.elabftw.net/install/generateSecretKey.php
# if you don't want to get it from an external source you can also do that:
# docker run --rm -t --entrypoint '/bin/sh' elabftw/elabimg -c "php /elabftw/web/install/generateSecretKey.php"
- SECRET_KEY=
# optional: change to your server name in nginx config
- SERVER_NAME=localhost
# optional: disable https, use this to have an http server listening on port 443
# useful if the SSL stack is handled by haproxy or something alike
- DISABLE_HTTPS=false
# set to true to use letsencrypt certificates
# note: does nothing if DISABLE_HTTPS is set to true
- ENABLE_LETSENCRYPT=false
# no need to change
- MAX_PHP_MEMORY=256M
# no need to change
- MAX_UPLOAD_SIZE=100M
# better if changed (see list of available values: http://php.net/manual/en/timezones.php
- PHP_TIMEZONE=Europe/Paris
# again
- TZ=Europe/Paris
# enable if you want nginx to be configured with set_real_ip_from directives
- SET_REAL_IP=false
# the IP address/addresses. Separate them with a , AND A SPACE. Several set_real_ip_from lines will be added to the nginx config. One for each.
# this does nothing if SET_REAL_IP is set to false
- SET_REAL_IP_FROM=192.168.31.48, 192.168.0.42, 10.10.13.37
# optional: set the limit of simultaneous request that will be server
# see http://php.net/manual/en/install.fpm.configuration.php
# default is 50
- PHP_MAX_CHILDREN=50
# optional: adjust the max execution time of PHP scripts. Allows for bigger ZIP exports.
- PHP_MAX_EXECUTION_TIME=120
# optional: use a redis server to store the PHP sessions
- USE_REDIS=false
# optional: set an IP or hostname for the redis server
- REDIS_HOST=redis
# optional: set a custom port for redis
- REDIS_PORT=6379
# optional: enable ipv6 (make sure you have AAAA dns record!)
- ENABLE_IPV6=false
# adjust the user/group that will own the uploaded files
# useful in very particular situations, like with NFSv4
# you don't really need to change this in most situations
# so this is left commented (default values are shown)
#- ELABFTW_USER=nginx
#- ELABFTW_GROUP=nginx
#- ELABFTW_USERID=100
#- ELABFTW_GROUPID=101
ports:
# if you want elabftw to run on a different port, change the first number
# host:container
- '443:443'
# if you are aiming for running multiple instances of this container you can put a range like so:
# - "3100-3200:443"
# use redis for session storage if that is the case, or configure your load balancer with sticky sessions
volumes:
# this is where you will keep the uploaded files persistently
# for Windows users it might look like this
# - D:\Users\Nico\elab-data\web:/elabftw/uploads
# host:container
- /var/elabftw/web:/elabftw/uploads
#
# TLS configuration
#
# Note: if your certificate is not from letsencrypt, make sure to have those two files:
#
# /etc/letsencrypt/live/SERVER_NAME/fullchain.pem
# /etc/letsencrypt/live/SERVER_NAME/privkey.pem
#
# in the folder /etc/letsencrypt (or any folder you like as long as you adapt the line below
# replace SERVER_NAME with the value of SERVER_NAME of course.
#
# if you have enabled letsencrypt, uncomment the line below
# path to the folder with TLS certificate + private key
# host:container
#- /etc/letsencrypt:/ssl
#
# MYSQL cert path
#- /path/to/cert/folder:/mysql-cert
networks:
- elabftw-net
# the mysql database image
mysql:
image: mysql:5.7
restart: always
container_name: mysql
# drop some capabilities
cap_drop:
- AUDIT_WRITE
- MKNOD
- SYS_CHROOT
- SETFCAP
- NET_RAW
environment:
# need to change
- MYSQL_ROOT_PASSWORD=secr3t
# no need to change
- MYSQL_DATABASE=elabftw
# no need to change
- MYSQL_USER=elabftw
# need to change IMPORTANT: this should be the same password as DB_PASSWORD from the elabftw container
- MYSQL_PASSWORD=secr3t
# need to change, this is your timezone, see PHP_TIMEZONE from the elabftw container
- TZ=Europe/Paris
volumes:
# this is where you will keep the database persistently
# for Windows users it might look like this
# - D:\Users\Nico\elab-data\mysql:/var/lib/mysql
# host:container
- /var/elabftw/mysql:/var/lib/mysql
# expose should work, but sometimes it doesn't so use full port mapping
ports:
- '3306:3306'
#expose:
# - 3306
networks:
- elabftw-net
# example of a redis container
# uncomment if you want to spawn a redis container to manage sessions
#redis:
# image: redis:5.0-alpine
# restart: always
# container_name: redis
# networks:
# - elabftw-net
# the internal elabftw network
networks:
elabftw-net: