2019-12-18 18:39:33 +00:00
|
|
|
FROM alpine:3
|
|
|
|
|
2023-03-25 08:07:43 +00:00
|
|
|
LABEL maintainer="Varakh <varakh@varakh.de>" \
|
|
|
|
description="filebin" \
|
|
|
|
org.opencontainers.image.authors="Varakh" \
|
|
|
|
org.opencontainers.image.revision="${REVISION}" \
|
|
|
|
org.opencontainers.image.vendor="Varakh" \
|
|
|
|
org.opencontainers.image.title="filebin" \
|
|
|
|
org.opencontainers.image.description="filebin" \
|
|
|
|
org.opencontainers.image.base.name="alpine:3" \
|
|
|
|
org.opencontainers.artifact.created=${CREATED} \
|
|
|
|
org.opencontainers.image.source=${SOURCE_URL}
|
2019-12-18 18:39:33 +00:00
|
|
|
|
2023-03-25 08:07:43 +00:00
|
|
|
ENV RECONFIGURE=true \
|
|
|
|
MIGRATE=true \
|
|
|
|
PHP_MEMORY_LIMIT=512M \
|
|
|
|
MAX_UPLOAD=1024M \
|
|
|
|
PHP_MAX_FILE_UPLOAD=100 \
|
|
|
|
PHP_MAX_POST=1024M \
|
|
|
|
DB_DSN='' \
|
|
|
|
DB_HOST=localhost \
|
|
|
|
DB_PORT=5432 \
|
|
|
|
DB_DRIVER=postgre \
|
|
|
|
DB_NAME=fb \
|
|
|
|
DB_USER=fb \
|
|
|
|
DB_PASS=fb \
|
|
|
|
DB_PREFIX='' \
|
|
|
|
DB_PCONNECT='0' \
|
|
|
|
DB_DEBUG='1' \
|
|
|
|
DB_CHAR_SET=utf8 \
|
|
|
|
DB_COLLAT=utf8_bin \
|
|
|
|
DB_SWAP_PRE='' \
|
|
|
|
DB_ENCRYPT='0' \
|
|
|
|
DB_COMPRESS='0' \
|
|
|
|
DB_STRICTON='0' \
|
|
|
|
DB_SAVE_QUERIES='0' \
|
|
|
|
BASE_URL='' \
|
|
|
|
INDEX_PAGE='' \
|
|
|
|
ENCRYPTION_KEY='' \
|
|
|
|
CACHE_BACKEND=dummy \
|
|
|
|
EMAIL_FROM='' \
|
|
|
|
UPLOAD_MAX_SIZE=1073741824 \
|
|
|
|
UPLOAD_MAX_TEXT_SIZE=2097152 \
|
|
|
|
UPLOAD_MAX_AGE=432000 \
|
|
|
|
ACTIONS_MAX_AGE=86400 \
|
|
|
|
SMALL_UPLOAD_SIZE=5120 \
|
|
|
|
TARBALL_MAX_SIZE=1073741824 \
|
|
|
|
TARBALL_CACHE_TIME=300 \
|
|
|
|
MAX_INVITATION_KEYS=3 \
|
|
|
|
SMTP_ENABLED=false \
|
|
|
|
SMTP_PROTOCOL='smtp' \
|
|
|
|
SMTP_HOST='' \
|
|
|
|
SMTP_PORT=587 \
|
|
|
|
SMTP_CRYPTO='tls' \
|
|
|
|
SMTP_USER='' \
|
|
|
|
SMTP_PASS=''
|
2019-12-18 18:39:33 +00:00
|
|
|
|
|
|
|
ADD src/wait-for.sh /wait-for.sh
|
2023-03-25 08:07:43 +00:00
|
|
|
ADD fb_src/ /var/www
|
2019-12-18 20:32:57 +00:00
|
|
|
|
2019-12-18 18:39:33 +00:00
|
|
|
# install dependencies
|
|
|
|
RUN chmod -x /wait-for.sh && \
|
|
|
|
apk add --update --no-cache \
|
|
|
|
nginx \
|
|
|
|
s6 \
|
|
|
|
curl \
|
|
|
|
python3 \
|
|
|
|
py-pygments \
|
2019-12-18 23:12:03 +00:00
|
|
|
imagemagick \
|
|
|
|
ghostscript \
|
|
|
|
msmtp \
|
2019-12-18 18:39:33 +00:00
|
|
|
composer \
|
2022-12-16 22:31:08 +00:00
|
|
|
php81 \
|
|
|
|
php81-fpm \
|
|
|
|
php81-intl \
|
|
|
|
php81-curl \
|
|
|
|
php81-dom \
|
|
|
|
php81-pcntl \
|
|
|
|
php81-posix \
|
|
|
|
php81-session \
|
|
|
|
php81-gd \
|
|
|
|
php81-exif \
|
|
|
|
php81-phar \
|
|
|
|
php81-pdo \
|
|
|
|
php81-pgsql \
|
|
|
|
php81-pdo_pgsql \
|
|
|
|
php81-pdo_mysql \
|
|
|
|
php81-mysqli \
|
|
|
|
php81-fileinfo \
|
|
|
|
php81-mbstring \
|
|
|
|
php81-ctype \
|
|
|
|
php81-ldap \
|
|
|
|
php81-pecl-memcached \
|
2019-12-18 18:39:33 +00:00
|
|
|
memcached \
|
|
|
|
ca-certificates && \
|
|
|
|
rm -rf /var/cache/apk/* && \
|
|
|
|
apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted && \
|
2019-12-18 20:32:57 +00:00
|
|
|
# prepare www dir
|
2019-12-18 18:39:33 +00:00
|
|
|
cp -r /var/www/application/config/example/* /var/www/application/config && \
|
|
|
|
# set environments
|
2022-12-16 22:31:08 +00:00
|
|
|
sed -i "s|;*memory_limit =.*|memory_limit = ${PHP_MEMORY_LIMIT}|i" /etc/php81/php.ini && \
|
|
|
|
sed -i "s|;*upload_max_filesize =.*|upload_max_filesize = ${MAX_UPLOAD}|i" /etc/php81/php.ini && \
|
|
|
|
sed -i "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" /etc/php81/php.ini && \
|
|
|
|
sed -i "s|;*post_max_size =.*|post_max_size = ${PHP_MAX_POST}|i" /etc/php81/php.ini && \
|
|
|
|
sed -i 's+.*sendmail_path =.*+sendmail_path = "/usr/bin/msmtp -C /var/www/msmtprc --logfile /var/www/msmtp.log -a filebinmail -t"+' /etc/php81/php.ini && \
|
2019-12-18 18:39:33 +00:00
|
|
|
# clean up and permissions
|
|
|
|
rm -rf /var/cache/apk/* && \
|
2022-01-18 23:16:03 +00:00
|
|
|
chown nobody:nginx -R /var/www && \
|
2022-06-03 23:47:49 +00:00
|
|
|
rm /usr/bin/php && \
|
2022-12-16 22:31:08 +00:00
|
|
|
ln -s /usr/bin/php81 /usr/bin/php
|
2019-12-18 18:39:33 +00:00
|
|
|
|
|
|
|
# Add nginx config
|
|
|
|
ADD src/filebin.nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
# add templates for replace env variables in the application
|
|
|
|
ADD src/config/database.php.tpl /var/www/application/config/database.php.tpl
|
|
|
|
ADD src/config/config-local.php.tpl /var/www/application/config/config-local.php.tpl
|
2019-12-18 23:12:03 +00:00
|
|
|
ADD src/config/email.php.tpl /var/www/application/config/email.php.tpl
|
2019-12-18 18:39:33 +00:00
|
|
|
ADD src/crontab /etc/periodic/15min/crontab
|
2019-12-18 23:12:03 +00:00
|
|
|
ADD src/configure.php /configure.php
|
|
|
|
ADD src/configure-mail.sh /var/www/configure-mail.sh
|
2019-12-18 18:39:33 +00:00
|
|
|
|
|
|
|
# add overlay
|
|
|
|
ADD src/s6/ /etc/s6/
|
|
|
|
|
|
|
|
# expose start
|
2022-01-18 23:16:03 +00:00
|
|
|
CMD /usr/bin/php /configure.php && exec s6-svscan /etc/s6/
|