Skip to content

Update ubuntu php #188

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

Merged
merged 2 commits into from
Apr 20, 2025
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
7 changes: 3 additions & 4 deletions tools/docker-dev/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -e
cd "$(dirname "$0")"

docker-compose down
docker-compose build --no-cache
docker image prune
docker-compose build
docker image prune
45 changes: 33 additions & 12 deletions tools/docker-dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
version: "3.9"
networks:
default:
name: unity_dev_network
services:
identity:
hostname: identity
build: identity
ports:
- "8010:80"
web:
hostname: web
build: web
ports:
- "8000:80"
volumes:
- ../../:/var/www/unity-web-portal
- "389:389"
healthcheck:
test: ["CMD-SHELL", "if [ -f /tmp/up ]; then (nc -z localhost 389 && touch /tmp/up); else true; fi"]
interval: 1s
sql:
hostname: sql
build: sql
ports:
- "8020:80"
- "3306:3306"
healthcheck:
test: ["CMD-SHELL", "if [ -f /tmp/up ]; then (nc -z localhost 3306 && touch /tmp/up); else true; fi"]
interval: 1s
smtp:
hostname: smtp
image: schickling/mailcatcher
ports:
- "8030:1080"
redis:
hostname: redis
image: redis
networks:
default:
name: unity_dev_network
build: redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD-SHELL", "if [ -f /tmp/up ]; then (nc -z localhost 6379 && touch /tmp/up); else true; fi"]
interval: 1s
web:
hostname: web
build: web
ports:
- "8000:80"
volumes:
- ../../:/var/www/unity-web-portal
depends_on:
identity:
condition: service_healthy
sql:
condition: service_healthy
smtp:
condition: service_started
redis:
condition: service_healthy
8 changes: 5 additions & 3 deletions tools/docker-dev/identity/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

# OpenLDAP Server
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
slapd \
ldap-utils \
apache2 \
phpldapadmin
phpldapadmin \
netcat-openbsd
RUN rm -rf /var/lib/ldap
RUN mkdir /var/lib/ldap
RUN chown openldap:openldap /var/lib/ldap
Expand All @@ -32,8 +33,9 @@ COPY phpldapadmin-apache.conf /etc/apache2/sites-available/phpldapadmin.conf
RUN a2dissite 000-default
RUN a2ensite phpldapadmin
RUN echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf
RUN sed -i '/memory_limit/c\memory_limit = -1' /etc/php/8.3/apache2/php.ini

EXPOSE 80
EXPOSE 389

CMD apache2ctl -D FOREGROUND & slapd -h "ldap:/// ldapi:///" -u openldap -g openldap -d 0
CMD apache2ctl -D FOREGROUND & slapd -h "ldap:/// ldapi:///" -u openldap -g openldap -d 0
4 changes: 4 additions & 0 deletions tools/docker-dev/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM redis

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y netcat-openbsd
5 changes: 2 additions & 3 deletions tools/docker-dev/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

set -e
cd "$(dirname "$0")"

docker-compose up
docker-compose up
10 changes: 6 additions & 4 deletions tools/docker-dev/sql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
mariadb-server \
mariadb-client \
apache2 \
phpmyadmin
php8.3 \
phpmyadmin \
netcat-openbsd
RUN sed -i '/bind-address/c\bind-address = 0.0.0.0' /etc/mysql/mariadb.conf.d/50-server.cnf
COPY bootstrap.sql /tmp/bootstrap.sql

RUN service mysql start; \
RUN service mariadb start; \
mariadb -e "CREATE DATABASE unity"; \
mariadb -e "CREATE USER 'unity'@'%' IDENTIFIED BY 'password'"; \
mariadb -e "GRANT ALL PRIVILEGES ON unity.* TO 'unity'@'%'"; \
Expand All @@ -28,4 +30,4 @@ RUN echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf
EXPOSE 80
EXPOSE 3306

CMD apache2ctl -D FOREGROUND & mysqld
CMD apache2ctl -D FOREGROUND & mysqld --user=root
14 changes: 10 additions & 4 deletions tools/docker-dev/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

# Web Server Setup
ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -12,16 +12,22 @@ RUN apt-get update && apt-get install -y \
php-ldap \
php-pdo \
php-redis \
php-cli
php-cli \
php-mbstring \
php-xml
COPY htpasswd /etc/apache2/.htpasswd
RUN chown www-data /etc/apache2/.htpasswd
COPY unity-apache.conf /etc/apache2/sites-available/unity.conf
RUN a2dissite 000-default
RUN a2ensite unity
RUN echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf

RUN sed -i '/display_errors/c\display_errors = on' /etc/php/7.4/apache2/php.ini
RUN sed -i '/display_errors/c\display_errors = on' /etc/php/8.3/apache2/php.ini
RUN sed -i '/zend.assertions/c\zend.assertions = 1' /etc/php/8.3/apache2/php.ini
RUN sed -i '/zend.assertions/c\zend.assertions = 1' /etc/php/8.3/cli/php.ini
RUN sed -i '/memory_limit/c\memory_limit = -1' /etc/php/8.3/apache2/php.ini

# Start apache2 server
EXPOSE 80

CMD ["apache2ctl", "-D", "FOREGROUND"]
CMD ["bash", "-c", "pushd /var/www/unity-web-portal/workers >/dev/null && echo 'updating LDAP cache...' && php ./update-ldap-cache.php && popd >/dev/null && apache2ctl -D FOREGROUND"]
Loading