Compare commits
5 Commits
6c1044fef4
...
3086c9db9b
Author | SHA1 | Date | |
---|---|---|---|
3086c9db9b | |||
4ee1cf73f1 | |||
5466e98fb4 | |||
34ff0135d9 | |||
324e6abd46 |
8
13.0/fpm-alpine/config/redis.config.php
Normal file
8
13.0/fpm-alpine/config/redis.config.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
$CONFIG = array (
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
'redis' => array(
|
||||||
|
'host' => 'redis',
|
||||||
|
'port' => 6379,
|
||||||
|
),
|
||||||
|
);
|
@ -87,13 +87,13 @@ RUN { \
|
|||||||
echo 'opcache.revalidate_freq=1'; \
|
echo 'opcache.revalidate_freq=1'; \
|
||||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
\
|
\
|
||||||
mkdir /var/www/data; \
|
mkdir /data; \
|
||||||
|
chown -R www-data:root /data; \
|
||||||
chown -R www-data:root /var/www; \
|
chown -R www-data:root /var/www; \
|
||||||
chmod -R g=u /var/www
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_VERSION 13.0.2
|
ENV NEXTCLOUD_VERSION 13.0.2
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
@ -115,6 +115,7 @@ RUN set -ex; \
|
|||||||
|
|
||||||
COPY *.sh /
|
COPY *.sh /
|
||||||
COPY config/* /usr/src/nextcloud/config/
|
COPY config/* /usr/src/nextcloud/config/
|
||||||
|
#HEALTHCHECK --interval=1s --timeout=3s --retries=16 \
|
||||||
|
#CMD test $(ps ax | grep php-fpm | grep -v grep | wc -l) -gt 0 && echo okay
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
|
@ -1,11 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$autoconfig_enabled = false;
|
$autoconfig_enabled = false;
|
||||||
|
|
||||||
if (getenv('SQLITE_DATABASE')) {
|
if (getenv('SQLITE_DATABASE')) {
|
||||||
$AUTOCONFIG["dbtype"] = "sqlite";
|
$AUTOCONFIG["dbtype"] = "sqlite";
|
||||||
$AUTOCONFIG["dbname"] = getenv('SQLITE_DATABASE');
|
$AUTOCONFIG["dbname"] = getenv('SQLITE_DATABASE');
|
||||||
$autoconfig_enabled = true;
|
$autoconfig_enabled = true;
|
||||||
|
}elseif (getenv('MYSQL_ROOT_PASSWORD') && getenv('MYSQL_ROOT_USER') && getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
|
||||||
|
$root_user = getenv('MYSQL_ROOT_USER');
|
||||||
|
$root_password = getenv('MYSQL_ROOT_PASSWORD');
|
||||||
|
$user = getenv('MYSQL_USER');
|
||||||
|
$password = getenv('MYSQL_PASSWORD');
|
||||||
|
$database = getenv('MYSQL_DATABASE');
|
||||||
|
$host = getenv('MYSQL_HOST');
|
||||||
|
// Erase root environment variables
|
||||||
|
putenv('MYSQL_ROOT_USER');
|
||||||
|
putenv('MYSQL_ROOT_PASSWORD');
|
||||||
|
// Create connection
|
||||||
|
$connection = new mysqli($host, $root_user, $root_password);
|
||||||
|
// Check connection
|
||||||
|
if ($connection->connect_error) {
|
||||||
|
die("Connection failed: " . $connection->connect_error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create database
|
||||||
|
$create_database = "CREATE DATABASE " .$database;
|
||||||
|
$create_user = "GRANT ALL PRIVILEGES ON " .$database. ".* TO '" .$user."'@'%' IDENTIFIED BY '" .$password. "';";
|
||||||
|
if ($connection->query($create_database) && $connection->query($create_user)) {
|
||||||
|
$AUTOCONFIG["dbtype"] = "mysql";
|
||||||
|
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
|
||||||
|
$AUTOCONFIG["dbuser"] = getenv('MYSQL_USER');
|
||||||
|
$AUTOCONFIG["dbpass"] = getenv('MYSQL_PASSWORD');
|
||||||
|
$AUTOCONFIG["dbhost"] = getenv('MYSQL_HOST');
|
||||||
|
$autoconfig_enabled = true;
|
||||||
|
} else {
|
||||||
|
echo "Error creating database: " . $connection->error;
|
||||||
|
}
|
||||||
|
|
||||||
|
$connection->close();
|
||||||
|
|
||||||
} elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
|
} elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
|
||||||
$AUTOCONFIG["dbtype"] = "mysql";
|
$AUTOCONFIG["dbtype"] = "mysql";
|
||||||
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
|
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
|
||||||
|
8
13.0/fpm/config/redis.config.php
Normal file
8
13.0/fpm/config/redis.config.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
$CONFIG = array (
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
'redis' => array(
|
||||||
|
'host' => 'redis',
|
||||||
|
'port' => 6379,
|
||||||
|
),
|
||||||
|
);
|
@ -101,6 +101,8 @@ __SQLITE_DATABASE__:
|
|||||||
- `SQLITE_DATABASE` Name of the database using sqlite
|
- `SQLITE_DATABASE` Name of the database using sqlite
|
||||||
|
|
||||||
__MYSQL/MariaDB__:
|
__MYSQL/MariaDB__:
|
||||||
|
- `MYSQL_ROOT_USER` Name of mysql / mariadb root user.
|
||||||
|
- `MYSQL_ROOT_PASSWORD` Root Password of the database, used to create the MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE.
|
||||||
- `MYSQL_DATABASE` Name of the database using mysql / mariadb.
|
- `MYSQL_DATABASE` Name of the database using mysql / mariadb.
|
||||||
- `MYSQL_USER` Username for the database using mysql / mariadb.
|
- `MYSQL_USER` Username for the database using mysql / mariadb.
|
||||||
- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb.
|
- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb.
|
||||||
|
Loading…
Reference in New Issue
Block a user