Skip to content

Commit 22e582e

Browse files
committed
update docker compose for ubuntu 24.04, php8.3
1 parent ea1e294 commit 22e582e

File tree

7 files changed

+56
-30
lines changed

7 files changed

+56
-30
lines changed

tools/docker-dev/build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
2-
2+
set -e
33
cd "$(dirname "$0")"
4-
54
docker-compose down
6-
docker-compose build --no-cache
7-
docker image prune
5+
docker-compose build
6+
docker image prune
Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,44 @@
1-
version: "3.9"
1+
networks:
2+
default:
3+
name: unity_dev_network
24
services:
35
identity:
46
hostname: identity
57
build: identity
68
ports:
79
- "8010:80"
8-
web:
9-
hostname: web
10-
build: web
11-
ports:
12-
- "8000:80"
13-
volumes:
14-
- ../../:/var/www/unity-web-portal
10+
- "389:389"
11+
healthcheck:
12+
test: ["CMD", "nc", "-z", "localhost", "389"]
1513
sql:
1614
hostname: sql
1715
build: sql
1816
ports:
1917
- "8020:80"
18+
- "3306:3306"
19+
healthcheck:
20+
test: ["CMD", "nc", "-z", "localhost", "3306"]
2021
smtp:
2122
hostname: smtp
2223
image: schickling/mailcatcher
2324
ports:
2425
- "8030:1080"
2526
redis:
2627
hostname: redis
27-
image: redis
28-
networks:
29-
default:
30-
name: unity_dev_network
28+
build: redis
29+
ports:
30+
- "6379:6379"
31+
healthcheck:
32+
test: ["CMD", "nc", "-z", "localhost", "6379"]
33+
web:
34+
hostname: web
35+
build: web
36+
ports:
37+
- "8000:80"
38+
volumes:
39+
- ../../:/var/www/unity-web-portal
40+
depends_on:
41+
- identity
42+
- sql
43+
- smtp
44+
- redis

tools/docker-dev/identity/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

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

3638
EXPOSE 80
3739
EXPOSE 389
3840

39-
CMD apache2ctl -D FOREGROUND & slapd -h "ldap:/// ldapi:///" -u openldap -g openldap -d 0
41+
CMD apache2ctl -D FOREGROUND & slapd -h "ldap:/// ldapi:///" -u openldap -g openldap -d 0

tools/docker-dev/redis/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM redis
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
RUN apt-get update && apt-get install -y netcat-openbsd

tools/docker-dev/run.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
2+
set -e
33
cd "$(dirname "$0")"
4-
5-
docker-compose up
4+
docker-compose up

tools/docker-dev/sql/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update && apt-get install -y \
55
mariadb-server \
66
mariadb-client \
77
apache2 \
8-
phpmyadmin
8+
php8.3 \
9+
phpmyadmin \
10+
netcat-openbsd
911
RUN sed -i '/bind-address/c\bind-address = 0.0.0.0' /etc/mysql/mariadb.conf.d/50-server.cnf
1012
COPY bootstrap.sql /tmp/bootstrap.sql
1113

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

31-
CMD apache2ctl -D FOREGROUND & mysqld
33+
CMD apache2ctl -D FOREGROUND & mysqld --user=root

tools/docker-dev/web/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
# Web Server Setup
44
ARG DEBIAN_FRONTEND=noninteractive
@@ -12,16 +12,22 @@ RUN apt-get update && apt-get install -y \
1212
php-ldap \
1313
php-pdo \
1414
php-redis \
15-
php-cli
15+
php-cli \
16+
php-mbstring \
17+
php-xml
1618
COPY htpasswd /etc/apache2/.htpasswd
19+
RUN chown www-data /etc/apache2/.htpasswd
1720
COPY unity-apache.conf /etc/apache2/sites-available/unity.conf
1821
RUN a2dissite 000-default
1922
RUN a2ensite unity
2023
RUN echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf
2124

22-
RUN sed -i '/display_errors/c\display_errors = on' /etc/php/7.4/apache2/php.ini
25+
RUN sed -i '/display_errors/c\display_errors = on' /etc/php/8.3/apache2/php.ini
26+
RUN sed -i '/zend.assertions/c\zend.assertions = 1' /etc/php/8.3/apache2/php.ini
27+
RUN sed -i '/zend.assertions/c\zend.assertions = 1' /etc/php/8.3/cli/php.ini
28+
RUN sed -i '/memory_limit/c\memory_limit = -1' /etc/php/8.3/apache2/php.ini
2329

2430
# Start apache2 server
2531
EXPOSE 80
2632

27-
CMD ["apache2ctl", "-D", "FOREGROUND"]
33+
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"]

0 commit comments

Comments
 (0)