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

Docker-compose for flyspray #1

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3.3"

services:
flyspray_db:
image: mariadb
container_name: flyspray_db
restart: always
volumes:
- flyspray_db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "heslo"
flyspray_apache:
container_name: flyspray_apache
build: web/
links:
- flyspray_db:db
ports:
- "8081:80"
restart: always
volumes:
- flyspray_fly:/var/www/html/
- flyspray_attachments:/var/www/html/flyspray/attachments
- flyspray_avatar:/var/www/html/flyspray/avatars
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: flyspray_phpmyadmin
ports:
- 8082:80
links:
- flyspray_db:db
environment:
MYSQL_ROOT_PASSWORD: "heslo"
depends_on:
- flyspray_db
volumes:
flyspray_db:
flyspray_fly:
flyspray_avatar:
flyspray_attachments:
50 changes: 50 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM php:7.4-apache

RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y libpng-dev nano git
RUN apt-get install -y zlib1g-dev zip libzip-dev libzip4 libfreetype6-dev libjpeg62-turbo-dev libpng-dev
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install mysqli exif pdo gd zip pdo_mysql mysqli
#RUN docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/


#RUN docker-php-ext-enable mysqli



RUN echo "<VirtualHost *:80> \n DocumentRoot /var/www/html/flyspray \n </VirtualHost>" > /etc/apache2/sites-available/000-default.conf



#RUN curl -s -L https://github.com/Flyspray/flyspray/archive/master.tar.gz -O
#RUN tar -xf master.tar.gz -C /var/www/html/ && \
# mv /var/www/html/flyspray-master /var/www/html/flyspray

RUN git clone https://github.com/poucz/flyspray.git
#RUN git clone https://github.com/Flyspray/flyspray.git

#DEBUG:
RUN cd /var/www/html/ && echo "<?php\n phpinfo(); \n ?>" > index.php


#KOMPOSITOR:
RUN cd /var/www/html/flyspray/ && \
curl -sS https://getcomposer.org/installer | php && \
php composer.phar install --no-dev


COPY cleanupaftersetup.php /var/www/html/flyspray/setup/cleanupaftersetup.php
COPY docker-php-entrypoint /usr/local/bin/
COPY php.ini /usr/local/etc/php/conf.d/php.ini



#WRITE PERMISSION TO FILE:
RUN cd /var/www/html/flyspray/ && \
touch flyspray.conf.php && chmod 666 flyspray.conf.php && \
chmod -R 777 setup && \
chmod +x /usr/local/bin/docker-php-entrypoint



24 changes: 24 additions & 0 deletions web/cleanupaftersetup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
function delete_directory($dirname) {
if (is_dir($dirname))
$dir_handle = opendir($dirname);
if (!$dir_handle)
return false;
while($file = readdir($dir_handle)) {
if ($file != "." && $file != "..") {
if (!is_dir($dirname."/".$file))
unlink($dirname."/".$file);
else
delete_directory($dirname.'/'.$file);
}
}
closedir($dir_handle);
@rmdir($dirname);
return true;
}


chdir('..');
delete_directory("setup");
echo '<a href="../">You can now use Flyspray.</a>';
?>
15 changes: 15 additions & 0 deletions web/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e

FLY_SPRAY=/var/www/html/flyspray/

chmod 777 ${FLY_SPRAY}/avatars ${FLY_SPRAY}/cache ${FLY_SPRAY}/attachments
chmod 777 ${FLY_SPRAY}


# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi

exec "$@"
3 changes: 3 additions & 0 deletions web/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

upload_max_filesize=100M
post_max_size = 100M