Skip to content

Commit 52f17a7

Browse files
committed
feat(config): move PHP configuration from runtime to build time
This commit is the second of a PR that will aim at dropping requirement to run containers with root permissions. This commit leverages env vars rather than sed & dynamic environment substitution for php.ini file.
1 parent 60ea64a commit 52f17a7

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN apk --no-cache --update \
4040
COPY linkstack /htdocs
4141
COPY configs/apache2/httpd.conf /etc/apache2/httpd.conf
4242
COPY configs/apache2/ssl.conf /etc/apache2/conf.d/ssl.conf
43+
COPY configs/php/php.ini /etc/php8.2/php.ini
4344

4445
RUN chown -R apache:apache /htdocs
4546
RUN find /htdocs -type d -print0 | xargs -0 chmod 0755
@@ -80,4 +81,4 @@ RUN sed -i 's/#LoadModule deflate_module/LoadModule deflate_module/' /etc/apache
8081
# Set console entry path
8182
WORKDIR /htdocs
8283

83-
CMD ["docker-entrypoint.sh"]
84+
CMD ["docker-entrypoint.sh"]

configs/php/php.ini

Whitespace-only changes.

docker-compose.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: "3.8"
22

33
services:
4-
54
linkstack:
65
hostname: 'linkstack'
76
image: 'linkstackorg/linkstack:latest'
@@ -16,10 +15,19 @@ services:
1615
volumes:
1716
- 'linkstack_data:/htdocs'
1817
ports:
19-
- '8188:80'
20-
- '8190:443'
18+
- '8080:80'
19+
- '8081:443'
20+
depends_on:
21+
- mysql
22+
links:
23+
- mysql
2124
restart: unless-stopped
25+
mysql:
26+
image: mysql:8
27+
environment:
28+
MYSQL_ROOT_PASSWORD: xeFgUGb5mPPn5q2d
29+
ports:
30+
- 3306:3306
2231

2332
volumes:
2433
linkstack_data:
25-

docker-entrypoint.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ echo '| Updating Configuration: PHP (/etc/php82/php.ini) |'
6363

6464
if [[ ${DEBUG} == "TRUE" && -d /debug ]]; then cp /etc/php82/php.ini /debug/php.BEFORE.ini;fi
6565

66-
# ALTER: Modify php memory limit and timezone
67-
sed -i "s/memory_limit = .*/memory_limit = ${PHP_MEMORY_LIMIT}/" /etc/php82/php.ini
68-
sed -i "s/upload_max_filesize = .*/upload_max_filesize = ${UPLOAD_MAX_FILESIZE}/" /etc/php82/php.ini
69-
sed -i "s#^;date.timezone =\$#date.timezone = \"${TZ}\"#" /etc/php82/php.ini
70-
71-
echo "is_llc_docker = true" >> /etc/php82/php.ini
72-
7366
if [[ ${DEBUG} == "TRUE" && -d /debug ]]; then cp /etc/php82/php.ini /debug/php.AFTER.ini;fi
7467

7568
# + ---------- + #

0 commit comments

Comments
 (0)