Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~
/.idea/
/docker-compose.override.yml
50 changes: 27 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,36 @@
# https://github.com/eventum/eventum
#

FROM php:5.6-fpm
FROM phpearth/php:7.1-nginx AS base

ARG EVENTUM_VERSION=3.3.3
ARG EVENTUM_MD5=7fde18feb868ad965aa186418eccd1c1
FROM base AS source
RUN apk add --no-cache curl

WORKDIR /usr/src/eventum
# download and unpack code
WORKDIR /source
ARG VERSION=3.7.1
RUN curl -fLSs https://github.com/eventum/eventum/releases/download/v$VERSION/eventum-$VERSION.tar.xz -o eventum.tar.xz

# step1: install eventum code
RUN set -xe \
&& curl -fLSs https://github.com/eventum/eventum/releases/download/v$EVENTUM_VERSION/eventum-$EVENTUM_VERSION.tar.gz -o eventum.tgz \
&& echo "$EVENTUM_MD5 *eventum.tgz" | md5sum -c - \
&& tar --strip-components=1 -xzf eventum.tgz \
&& rm -f eventum.tgz \
ARG CHECKSUM=060b2fa8b09cebaf442c2088137998fdfce1082487d83115cafa49bf12834689
RUN sha256sum eventum.tar.xz
RUN echo "$CHECKSUM *eventum.tar.xz" | sha256sum -c -

WORKDIR /app
RUN tar --strip-components=1 -xf /source/eventum.tar.xz

COPY php.ini /php.ini
RUN chmod 644 /php.ini

# build runtime image
FROM base
RUN apk add --no-cache php7.1-gd php7.1-intl php7.1-pdo_mysql
# update to use app root; required to change config as expose only subdir
RUN sed -i -e '/root/ s;/var/www/html;/app/htdocs;' /etc/nginx/conf.d/default.conf

WORKDIR /app
COPY --from=source /php.ini /etc/php/7.1/php.ini
COPY --from=source /app ./
RUN set -x \
&& chmod -R og-rwX config var \
&& chown -R www-data: config var \
&& du -sh

# step2: install dependencies
RUN set -xe \
&& ln -s /usr/local/bin/php /usr/bin \
&& apt-get update \
&& apt-get install -y --no-install-recommends libpng-dev libmcrypt-dev \
&& docker-php-ext-install pdo pdo_mysql gd mcrypt \
&& apt-get remove -y zlib1g-dev libpng12-dev zlib1g-dev libmcrypt-dev \
&& apt-get clean \
&& rm -rfv /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& php -m

USER www-data
37 changes: 17 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
version: '2.1'

volumes:
config:
mysql:
code:
name: eventum-3.3.3

services:
eventum:
image: eventum/eventum:3.3.3
build: .
volumes:
- code:/usr/src/eventum
- config:/usr/src/eventum/config
links:
- mysql
- ./php.ini:/etc/php/7.1/php.ini
ports:
- "8088:80"
logging:
driver: json-file
options:
max-size: "10m"
max-file: "10"

mysql:
image: mysql:5.6
image: percona:5.7
volumes:
- mysql:/var/lib/mysql
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=1
- MYSQL_DATABASE=eventum
logging:
driver: json-file
options:
max-size: "10m"
max-file: "10"

nginx:
build: nginx
ports:
- "8088:80"
links:
- eventum:fpm
volumes:
- code:/usr/src/eventum:ro
volumes:
mysql:

# vim:ts=2:sw=2:et
8 changes: 0 additions & 8 deletions nginx/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions nginx/nginx.conf

This file was deleted.

23 changes: 23 additions & 0 deletions php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
; disable production reporting
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = Off

; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On

; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; http://php.net/expose-php
expose_php = Off