1
0
mirror of https://gitlab.com/mojo42/Jirafeau.git synced 2025-04-25 14:01:59 +02:00

[FEATURE] Add docker image support

closes 

Signed-off-by: Jerome Jutteau <mojo@couak.net>
This commit is contained in:
Jerome Jutteau 2017-09-04 21:31:42 +02:00
parent 9180065986
commit d76baeb068
5 changed files with 103 additions and 0 deletions

25
Dockerfile Normal file

@ -0,0 +1,25 @@
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

38
docker/README.md Normal file

@ -0,0 +1,38 @@
# 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

34
docker/lighttpd.conf Normal file

@ -0,0 +1,34 @@
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 = ("")
}

2
docker/php.ini Normal file

@ -0,0 +1,2 @@
date.timezone = UTC
display_errors = stderr