Commit 236c3d78 authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files

snipeit.example, and README.md

parent f9431b28
# Dockerized [Snipe-IT](https://snipeitapp.com/)
This is a dockerized Snipe-IT instance, without any additional cruft. Just the `php-fpm` and Snipe-IT code. No webservers, no databases, no init.
## How to use this image
Obviously this needs a FastCGI-compatible webserver to be useful. The image exposes the code directory (`/opt/snipeit` by default). The webserver conainer should use the `--volumes-from` Docker CLI option, or `volumes_from` Docker Compose configuration file key.
It also needs access to a database. Access is configured via `DB_*` environment variables; see below.
### Configuration
Basic run-time configuration (database, e-mail system, etc) is done via Snipe-IT environment variables. Please refer to [Snipe-IT documentation](https://snipe-it.readme.io/docs/configuration) for more information. An [example env file](snipeit.example) is provided.
It is strongly suggested to copy the example env file as `snipeit.env` and use it via `--env-file` Docker CLI argument, or `env_file` Docker Compose configuration file key.
### Installation
Once the environment variables are set, and the webserver is configured, it's enough to just build and start the container. Upon accessing the webserver address you should be redirected to online set-up screen.
Permissions on any bind-mounted or volume-mounted directories are set automagically by the [entrypoint script](entrypoint.sh).
### Upgrading
The entrypoint script runs the upgrade script automagically on each run. Unless Snipe-It introduces breaking changes upgrading should be as simple as changing the `SNIPEIT_VERSION` build arg, rebuilding the image, and starting the container using the new image. Database migrations should get handled.
## [Build-time variables](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg)
Build time variables offer a way of customizing the image to your needs.
- `SNIPEIT_VERSION` (default: whatever the latest version is)
Version (or git tag) of Snipe-IT to install. Use the exact tag name, like `v4.4.1`.
- `SNIPEIT_TARBALL` (default: `"https://github.com/snipe/snipe-it/archive/${SNIPEIT_VERSION}.tar.gz"`)
The tarball to download and install Snipe-IT from. Usually there is no need to set it explicitly, unless you want to use some other source than the official one.
- `SNIPEIT_APP_DIR` (default: `"/opt/snipeit"`)
Directory to install Snipe-IT in, and which will be exposed as via `VOLUME` command in the Dockerfile. Affects [important directories](#important-directories).
- `SNIPEIT_APP_NAME` (default: `"snipeit"`)
App name. Used in `php-fpm` config. There is usually no need to set it explicitly.
- `SNIPEIT_APP_USER` (default: `"www-data"`)
- `SNIPEIT_APP_GROUP` (default: `""www-data"`)
- `SNIPEIT_APP_UID` (default: empty)
- `SNIPEIT_APP_GID` (default: empty)
- `SNIPEIT_LISTEN` (default: `[::]:9000`)
- `SNIPEIT_ACCESS_LOG` (default: `"/dev/null"`)
- `SNIPEIT_ERROR_LOG` (default: `"/dev/null"`)
- `SNIPEIT_SLOW_LOG` (default: `"/dev/null"`)
- `SNIPEIT_PID_FILE` (default: `"/var/run/php5-fpm.pid"`)
These are the same as the [respective `PHP_*` variables in `docker-php-fpm`](https://github.com/rysiekpl/docker-php-fpm#environment-variables). Please refer to `docker-php-fpm` documentation for more context.
## Important directories
These directories hold relevant data and should be either bind-mounted, or put in volume containers:
- `${SNIPEIT_APP_DIR}/plugins/` - installed plugins
- `${SNIPEIT_APP_DIR}/storage/logs/` - log directory for the webapp itself
- `${SNIPEIT_APP_DIR}/data/` - web app data
- `${SNIPEIT_APP_DIR}/keys/` - web app keys
- `${SNIPEIT_APP_DIR}/dumps/` - web app dumps
You might also want to consider putting `$SNIPEIT_ACCESS_LOG`, `$SNIPEIT_ERROR_LOG`, and `$SNIPEIT_SLOW_LOG` somewhere outside the container itself.
#
# Snipe IT envfile
#
# based on:
# https://github.com/snipe/snipe-it/blob/master/docker/docker.env
#
# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=production
APP_DEBUG=false
APP_KEY=Change_this_key_or_snipe_will_get_ya
APP_URL=http://127.0.0.1:32782
APP_TIMEZONE=Europe/Berlin
APP_LOCALE=en
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
# --------------------------------------------
# REQUIRED: OUTGOING MAIL SERVER SETTINGS
# --------------------------------------------
MAIL_DRIVER=smtp
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_ADDR=
MAIL_FROM_NAME=
MAIL_REPLYTO_ADDR=
MAIL_REPLYTO_NAME=
# --------------------------------------------
# REQUIRED: IMAGE LIBRARY
# This should be gd or imagick
# --------------------------------------------
IMAGE_LIB=gd
# --------------------------------------------
# OPTIONAL: SESSION SETTINGS
# --------------------------------------------
SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
COOKIE_NAME=snipeit_session
COOKIE_DOMAIN=null
SECURE_COOKIES=true
# --------------------------------------------
# OPTIONAL: CACHE SETTINGS
# --------------------------------------------
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment