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 fixes and upgrade #300

Merged
merged 2 commits into from
Mar 10, 2023
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
44 changes: 24 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
FROM php:7-apache
FROM php:8.1-apache

# Enable the Apache Headers module:
# Enable headers module
RUN ln -s /etc/apache2/mods-available/headers.load \
/etc/apache2/mods-enabled/headers.load

# Enable the Apache Rewrite module:
# Enable rewrite module
RUN ln -s /etc/apache2/mods-available/rewrite.load \
/etc/apache2/mods-enabled/rewrite.load

# Install GD, Imagick and ImageMagick as image conversion options:
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
# Install syste, build dependencies with apt
RUN DEBINA_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
libpng-dev \
libjpeg-dev \
libmagickwand-dev \
imagemagick \
&& pecl install \
imagick \
&& docker-php-ext-enable \
imagick \
&& docker-php-ext-configure \
gd --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install \
gd \
# Uninstall obsolete packages:
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

# Set php.ini-development as system php config
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

# Install php extensions
RUN pear config-set php_ini $PHP_INI_DIR/php.ini
RUN printf "\n" | pecl install imagick
RUN docker-php-ext-enable imagick
RUN docker-php-ext-configure gd --with-jpeg
RUN docker-php-ext-install gd
RUN docker-php-ext-enable gd
RUN docker-php-ext-install mysqli
RUN docker-php-ext-enable mysqli

# Clean instalation traces
RUN apt-get autoremove -y \
libpng-dev \
libjpeg-dev \
libmagickwand-dev \
# Remove obsolete files:
&& apt-get clean \
&& rm -rf \
/tmp/* \
/usr/share/doc/* \
/var/cache/* \
/var/lib/apt/lists/* \
/var/tmp/*

RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
48 changes: 37 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
version: '2.3'
version: '3.9'
volumes:
aixadadb:
networks:
aixada:
driver: bridge
services:
mariadb:
image: 'bitnami/mariadb:10.3'
environment:
- MARIADB_ROOT_PASSWORD=bitnami
image: 'bitnami/mariadb:10.6'
networks:
- aixada
ports:
- '3306:3306'
volumes:
- '~/data/aixada:/bitnami'
- 'aixadadb:/bitnami/mariadb'
environment:
- ALLOW_EMPTY_PASSWORD=no
- MARIADB_DATABASE=aixada
- MARIADB_USER=aixada
- MARIADB_PASSWORD=aixada
- MARIADB_ROOT_PASSWORD=root
- MARIADB_CHARACTER_SET=utf8
- MARIADB_COLLATE=utf8_general_ci
phpmyadmin:
image: 'bitnami/phpmyadmin:4'
ports:
- '8080:80'
- '443:443'
image: 'bitnami/phpmyadmin:5'
depends_on:
- mariadb
networks:
- aixada
ports:
- '8080:80'
links:
- 'mariadb:database'
environment:
- DATABASE_HOST=mariadb
- DATABASE_ALLOW_NO_PASSWORD=false
php:
build: .
depends_on:
- mariadb
networks:
- aixada
ports:
- '80:80'
- '443:443'
links:
- 'mariadb:database'
volumes:
- '.:/var/www/html'
depends_on:
- mariadb