Skip to content
Closed
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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Never bake local credentials or environment config into the image
config.php

# Git history
.git
.gitignore

# Local dev/test artifacts
/uploads/*
!/uploads/.htaccess
/var/*
!/var/.htaccess

# Composer dev cache
vendor/

# Docker files themselves
Dockerfile
docker-compose*.yaml
.dockerignore

# IDE and OS files
.DS_Store
*.code-workspace
.vscode/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ var/*

# Ignore node_modules folder
node_modules

.phpactor.json
62 changes: 62 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM php:8.3-apache

# 1. Install System Dependencies
RUN apt-get update && apt-get install -y \
unzip \
libicu-dev \
libzip-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libxml2-dev \
libcurl4-openssl-dev \
libonig-dev \
gettext \
&& rm -rf /var/lib/apt/lists/*

# 2. Install PHP Extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j"$(nproc)" \
mysqli \
pdo_mysql \
gd \
zip \
intl \
xml \
gettext \
bcmath \
curl \
mbstring

# Enable Apache mod_rewrite
RUN a2enmod rewrite \
&& sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf

# 3. Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html

# 4. Copy application source from local context
COPY . .

# 5. Install PHP Dependencies
RUN composer install --no-dev --optimize-autoloader

# 6. Configure PHP for Gibbon
RUN echo "upload_max_filesize = 50M" > /usr/local/etc/php/conf.d/gibbon.ini \
&& echo "post_max_size = 50M" >> /usr/local/etc/php/conf.d/gibbon.ini \
&& echo "max_input_vars = 8000" >> /usr/local/etc/php/conf.d/gibbon.ini \
&& echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/gibbon.ini \
&& echo "max_file_uploads = 20" >> /usr/local/etc/php/conf.d/gibbon.ini \
&& echo "allow_url_fopen = On" >> /usr/local/etc/php/conf.d/gibbon.ini \
&& echo "session.gc_maxlifetime = 1200" >> /usr/local/etc/php/conf.d/gibbon.ini

# 7. Permissions
RUN chown -R www-data:www-data /var/www/html \
&& find /var/www/html -type d -exec chmod 755 {} \; \
&& find /var/www/html -type f -exec chmod 644 {} \;

EXPOSE 80

CMD ["apache2-foreground"]
4 changes: 4 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
app:
ports:
- "8888:80"
36 changes: 36 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
app:
build: .
container_name: gibbon_app
depends_on:
db:
condition: service_healthy
restart: unless-stopped

db:
image: mysql:8.0
container_name: gibbon_db

# Gibbon Docker Environment Variables
environment:
# MySQL database name (default: gibbon)
- MYSQL_DATABASE=${MYSQL_DATABASE:-gibbon}
# MySQL application user credentials
- MYSQL_USER=${MYSQL_USER:-gibbon}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-gibbonpass}
# MySQL root password — keep this strong in production
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-rootpass}
volumes:
- gibbon_db_data:/var/lib/mysql
# Native password plugin ensures PHP can connect easily
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-rootpass}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped

volumes:
gibbon_db_data:
Loading