Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker support #841

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.github/
.git/
.idea/
.dockerignore
.gitattributes
.gitconfig
.gitignore
*.md
LICENCE
docker-compose.yml
Dockerfile
entrypoint.sh
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM php:7.4-apache@sha256:c04eff41a8cc583d3e09a355d45d6e30db0d25b3492c49a959e8907486034b5a
LABEL Description="Docker image for Open Web Analytics with Apache and php 7.4"

ENV APP_HOME /var/www/html

WORKDIR $APP_HOME
COPY . $APP_HOME

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
#install all the dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libicu-dev \
libpq-dev \
libmcrypt-dev \
git \
zip \
unzip \
libzip-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
&& docker-php-ext-install \
mysqli \
intl \
pcntl \
pdo_mysql \
pdo_pgsql \
pgsql \
zip \
opcache \
&& pecl install mcrypt \
&& docker-php-ext-enable mcrypt \
# Install and run composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
&& composer install --no-interaction --no-dev \
# Change uid and gid of apache to docker user uid/gid
&& usermod -u 1000 www-data && groupmod -g 1000 www-data \
&& chown -R www-data:www-data $APP_HOME

USER www-data
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.1'

services:
open-web-analytics:
build: . # Or open-web-analytics:latest
volumes:
- ./owa-config-dist.php:/var/www/html/owa-config.php
links:
- db
ports:
- "8080:80"
networks:
- open-web-analytics_network

db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: open-web-analytics
MYSQL_USER: user
MYSQL_PASSWORD: password
networks:
- open-web-analytics_network

networks:
open-web-analytics_network:
driver: bridge