Skip to content

Commit

Permalink
Replace su with gosu
Browse files Browse the repository at this point in the history
  • Loading branch information
nupplaphil committed Feb 16, 2022
1 parent 34bb363 commit 2f5e020
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM friendica:apache

RUN mkdir -p /usr/src/config
COPY addon.config.php /usr/src/config/
ENV PHP_MEMORY_LIMIT 512M
ENV PHP_UPLOAD_LIMIT 512M
RUN set -ex; \
{ \
echo "memory_limit=${PHP_MEMORY_LIMIT}"; \
echo "upload_max_filesize=${PHP_UPLOAD_LIMIT}"; \
echo "post_max_size=${PHP_UPLOAD_LIMIT}"; \
} > /usr/local/etc/php/conf.d/friendica.ini;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MYSQL_PASSWORD=
MYSQL_PASSWORD=test
MYSQL_DATABASE=friendica
MYSQL_USER=friendica
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_PORT=3306
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ services:
restart: always

app:
build: ./app
image: friendica:apache
restart: always
volumes:
- friendica:/var/www/html
environment:
- FRIENDICA_ADMIN_MAIL=
- FRIENDICA_TZ=
- FRIENDICA_LANG=
- FRIENDICA_URL=
- FRIENDICA_SITENAME=
- SMTP=
- [email protected]
- FRIENDICA_TZ=Europe/Vienna
- FRIENDICA_LANG=de
- FRIENDICA_URL=https://friendica.local
- FRIENDICA_SITENAME=Friendica
- SMTP=mail
- PHP_MEMORY_LIMIT=1024M
env_file:
- db.env
depends_on:
Expand All @@ -35,16 +36,23 @@ services:
- "80:80"

cron:
build: ./app
image: friendica:apache
restart: always
volumes:
- friendica:/var/www/html
entrypoint: /cron.sh
environment:
- [email protected]
- FRIENDICA_TZ=Europe/Vienna
- FRIENDICA_LANG=de
- FRIENDICA_URL=https://friendica.local
- FRIENDICA_SITENAME=Friendica
- SMTP=mail
depends_on:
- db
env_file:
- db.env

volumes:
db:
friendica:
friendica:
7 changes: 3 additions & 4 deletions 2021.09/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2021.09/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2021.09/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2022.02/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2022.02/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2022.02/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2022.05-dev/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2022.05-dev/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions 2022.05-dev/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down
7 changes: 3 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ set -eu

# run an command with the www-data user
run_as() {
set -- -c "cd /var/www/html; $*"
set -- sh -c "cd /var/www/html; $*"
if [ "$(id -u)" -eq 0 ]; then
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
else
sh -c "$1"
set -- gosu www-data "$@"
fi
"$@"
}

# checks if the the first parameter is greater than the second parameter
Expand Down

0 comments on commit 2f5e020

Please sign in to comment.