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 Development Environment #9607

Open
wants to merge 2 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
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Use the official PHP image as the base
FROM php:8.1-apache

# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
unzip \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libldap2-dev \
libzip-dev \
libmagickwand-dev \
libpq-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-install pdo pdo_pgsql pgsql mbstring exif pcntl bcmath gd zip intl ldap

# Install Imagick
RUN pecl install imagick && docker-php-ext-enable imagick

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Install Node.js and npm (latest stable version)
RUN curl -sL https://deb.nodesource.com/setup_current.x | bash - \
&& apt-get install -y nodejs

# Set the working directory
WORKDIR /var/www/html

# Debug: List files in the working directory
RUN ls -la /var/www/html

# Copy the entrypoint script
COPY entrypoint.sh /usr/local/bin/

# Ensure the entrypoint script is executable
RUN chmod +x /usr/local/bin/entrypoint.sh

# Copy the rest of the application code
COPY . .

# Set the timezone in php.ini
RUN echo "date.timezone = UTC" > /usr/local/etc/php/conf.d/timezone.ini

# Expose the port the app runs on
EXPOSE 80

# Set the entrypoint
ENTRYPOINT ["entrypoint.sh"]

# Start Apache server
CMD ["apache2-foreground"]
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,29 @@ inherits the browser support from there. This currently includes:
- Safari: (Current - 1) and Current
- Opera: Current

DEVELOPMENT SETUP
-----------------
- Clone the repository from Github
- Run 'docker-compose up' to start the development environment
- Run http://localhost:8080/installer
- Follow the instructions to install Roundcube
- DB Setup
- Database type: postgreSQL
- Database server: roundcube-db
- Database name: roundcubemail
- Database user: roundcube
- Database password: password
- IMAP Setup
- IMAP host: mailserver:143
- Create a test email account
- Run 'docker-compose exec roundcubeMailServer bash'
- Run 'setup email add [email protected] password'
- Final Steps
- Run 'docker-compose exec roundcube-webmail bash'
- Run 'php bin/install-jsdeps.sh'
- cd skins/elastic
- Run 'make'


LICENSE
-------
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.8'

services:
roundcube:
build: .
ports:
- "8080:80"
volumes:
- .:/var/www/html
depends_on:
- roundcube-db

roundcube-db:
image: postgres:13
restart: always
environment:
POSTGRES_DB: roundcubemail
POSTGRES_USER: roundcube
POSTGRES_PASSWORD: password
volumes:
- db_roundcubeData:/var/lib/postgresql/data

mailserver:
image: docker.io/mailserver/docker-mailserver:latest
container_name: roundcubeMailServer
hostname: mail.test.com
restart: always
cap_add:
- NET_ADMIN
- SYS_PTRACE

volumes:
db_roundcubeData:
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

# Install PHP dependencies
composer install --no-dev --optimize-autoloader

# Install JavaScript dependencies
npm install --include=dev --omit=optional

# Execute the CMD from the Dockerfile
exec "$@"
2 changes: 1 addition & 1 deletion skins/elastic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using the `lessc` command line tool (that you can install with `npm install`).
References to image files from the included CSS files can be appended
with cache-buster marks to avoid browser caching issues after updating.

Run `bin/updatecss.sh --dir skins/elastic` before packaging the skin
Run `php bin/updatecss.sh --dir skins/elastic` before packaging the skin
or after installing it on the destination system.


Expand Down