Skip to content

Commit bddc00d

Browse files
committed
EDIT docker update and cleanup
Composer 2.7 is out, instead of pinning our version to a specific minor version, it's probably safe to just pin our version to major version 2. composer's '--no-suggest' option is deprecated and does nothing now, so it was removed. Updated mariadb to 10.11 LTS. Added adminer as a front-end UI for mariadb to help with dev. Removed zend extension opcache.so as the version is very old and doesn't seem necessary. Removed container names as docker compose best practice is not to use them.
1 parent ec9c8d4 commit bddc00d

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ RUN apt-get update && apt-get install --no-install-recommends --no-install-sugge
1515
&& pecl install timezonedb xdebug\
1616
&& docker-php-ext-enable timezonedb xdebug
1717

18-
COPY --from=composer:2.6 /usr/bin/composer /usr/local/bin/composer
18+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
1919

2020
COPY docker/php.ini /usr/local/etc/php/
2121
COPY . /var/www/html
2222
COPY docker/docker-entrypoint-php-fpm.sh /
2323

2424
RUN cd /var/www/html \
25-
&& composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-suggest --optimize-autoloader \
25+
&& composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --optimize-autoloader \
2626
&& mkdir -p /var/www/html/app/tmp/cache/persistent /var/www/html/app/tmp/cache/models /var/www/html/app/tmp/logs \
2727
&& chown www-data:www-data -R /var/www/html/app/tmp/cache \
2828
&& chown www-data:www-data -R /var/www/html/app/tmp/logs

docker-compose.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
version: '3'
21
services:
32
db:
4-
image: mariadb:10.5
5-
container_name: ipeer_db
3+
image: mariadb:10.11
64
environment:
75
- MYSQL_ROOT_PASSWORD=randompassword
86
- MYSQL_DATABASE=ipeer
97
- MYSQL_USER=ipeer
108
- MYSQL_PASSWORD=ipeer
9+
- MARIADB_AUTO_UPGRADE=1
1110
volumes:
12-
- ./.data:/var/lib/mysql
11+
- mysqlDbData:/var/lib/mysql
1312
ports:
1413
- "13306:3306"
14+
adminer:
15+
image: adminer:latest
16+
ports:
17+
- 8060:8080
18+
depends_on:
19+
- db
1520
app: &app
1621
image: ubcctlt/ipeer-app
1722
build:
1823
context: .
19-
container_name: ipeer_app
2024
volumes:
2125
- .:/var/www/html
26+
- appTmp:/var/www/html/app/tmp
2227
environment:
2328
- IPEER_DB_HOST=db
2429
- IPEER_DB_USER=ipeer
@@ -43,13 +48,10 @@ services:
4348
- db
4449
worker: &worker
4550
<<: *app
46-
container_name: ipeer_worker
47-
command: cake/console/cake worker run
48-
ports:
49-
- "9002:9000"
51+
command: bash -c "sleep 5 && cake/console/cake worker run"
52+
volumes: []
5053
web:
51-
image: nginx:1.19-alpine
52-
container_name: ipeer_web
54+
image: nginx:1.27-alpine
5355
volumes:
5456
- ./app/webroot:/var/www/html
5557
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
@@ -60,15 +62,12 @@ services:
6062

6163
# for running unit tests
6264
app-unittest:
63-
image: ubcctlt/ipeer-app
65+
image: ubcctlt/ipeer-app-unittest
6466
build:
6567
context: .
6668
dockerfile: Dockerfile-app-unittest
67-
container_name: ipeer_app_unittest
6869
volumes:
6970
- .:/var/www/html
70-
ports:
71-
- "9001:9000"
7271
environment:
7372
- IPEER_DB_HOST=db
7473
- IPEER_DB_USER=ipeer
@@ -88,11 +87,14 @@ services:
8887
# for running unit tests
8988
web-unittest:
9089
image: nginx:1.19-alpine
91-
container_name: ipeer_web_unittest
9290
volumes:
9391
- ./app/webroot:/var/www/html
9492
- ./docker/nginx-unittest.conf:/etc/nginx/conf.d/default.conf
9593
ports:
9694
- "8081:80"
9795
depends_on:
9896
- app-unittest
97+
98+
volumes:
99+
mysqlDbData:
100+
appTmp:

docker/nginx-unittest.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ server {
1010
}
1111

1212
location ~ ^/.+\.php(/|$) {
13-
fastcgi_pass ipeer_app_unittest:9000;
13+
fastcgi_pass app-unittest:9000;
1414
include fastcgi_params;
1515
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
1616
}

docker/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ server {
1010
}
1111

1212
location ~ ^/.+\.php(/|$) {
13-
fastcgi_pass ipeer_app:9000;
13+
fastcgi_pass app:9000;
1414
include fastcgi_params;
1515
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
1616
}

docker/php.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ display_errors = Off
22
error_reporting = E_ALL & ~E_DEPRECATED
33
date.timezone = America/Vancouver
44
memory_limit=256M
5-
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/opcache.so

0 commit comments

Comments
 (0)