Commit d76baeb0 authored by Jérôme Jutteau's avatar Jérôme Jutteau

[FEATURE] Add docker image support

closes #114Signed-off-by: Jérôme Jutteau's avatarJerome Jutteau <mojo@couak.net>
parent 91800659
Pipeline #11543249 passed with stage
in 7 minutes and 23 seconds
FROM php:7.1.1-fpm-alpine
MAINTAINER "Jérôme Jutteau <mojo@jirafeau.net>"
RUN apk update && \
apk add lighttpd git && \
ln -snf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
echo "UTC" > /etc/timezone && \
mkdir -p /usr/local/etc/php / && \
mkdir /www
WORKDIR /www
COPY docker/php.ini /usr/local/etc/php/php.ini
COPY docker/lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY *.php LICENSE.txt ./
COPY lib lib
COPY media media
RUN chown -R www-data. . && \
chmod o=,ug=rwX -R . && \
apk del git && \
rm -rf /var/cache/apk/*
CMD php-fpm -D && lighttpd -D -f /etc/lighttpd/lighttpd.conf
EXPOSE 80
......@@ -55,6 +55,10 @@ Jirafeau project won't evolve to a file manager and will focus to keep a very fe
## Installation
This shows how to install Jirafeau by your own, it's quite simple but you can
also use a [docker image](https://hub.docker.com/r/mojo42/jirafeau/) or build
it yourself. Check [docker folder](docker/README.md) for more informations.
System requirements:
- PHP >= 5.6
- Optional, but recommended: Git >= 2.7
......
# Jirafeau in Docker
Jirafeau is a small PHP application so running it inside a docker is pretty straightforward.
## Get Jirafeau's docker image
### Pull docker image from Docker Hub
`docker pull mojo42/jirafeau`
### Build your own docker image
```
git clone https://gitlab.com/mojo42/Jirafeau.git
cd Jirafeau
docker build -t mojo42/jirafeau:latest .
```
## Run Jirafeau image
Once you have your Jirafeau's image, you can run a quick & dirty Jirafeau using:
```
docker run -d -p 8000:80 mojo42/jirafeau
```
and then connect on [locahost:8000](http://localhost:8000) and proceed to installation.
An other way to run Jirafeau (in a more controlled way) is to mount your Jirafeau's reprository in /www folder so your data are outside the container. This way, you will be able to easily make backups, upgrade Jirafeau, change configuration and develop Jirafeau.
```
docker run -d -p 8000:80 -v$(pwd):/www mojo42/jirafeau
```
There are also other ways to manage your container (like docker's volumes) but this is out of the scope of this documentation.
## Few notes
- SSL is currently not enabled in docker's image for the moment
- `var-...` folder where lives all uploaded data is protected from direct access
- Image has been made using [Alpine Linux](https://alpinelinux.org/) with [lighttpd](https://www.lighttpd.net/) which makes the container very light and start very quickly
var.basedir = "/www"
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
server.modules = (
"mod_access",
"mod_usertrack",
"mod_expire",
"mod_accesslog"
)
include "mime-types.conf"
include "mod_fastcgi_fpm.conf"
server.username = "lighttpd"
server.groupname = "lighttpd"
server.pid-file = "/run/lighttpd.pid"
server.errorlog = var.logdir + "/error.log"
server.indexfiles = ("index.php", "index.html", "index.htm")
server.follow-symlink = "enable"
server.document-root = var.basedir
dir-listing.show-header = "disable"
dir-listing.hide-header-file = "enable"
dir-listing.activate = "disable"
static-file.exclude-extensions = (".php")
accesslog.filename = var.logdir + "/access.log"
url.access-deny = ("~", ".inc")
$HTTP["url"] =~ "^/var-*" {
url.access-deny = ("")
}
date.timezone = UTC
display_errors = stderr
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