Compare commits
No commits in common. "f66e425d35427e247bfe3a5593eba8914bbdc3ac" and "fb5b3ab2c4d0bb137e1b8189e1a47b5df6804fa4" have entirely different histories.
f66e425d35
...
fb5b3ab2c4
@ -61,12 +61,6 @@ Simply run this command from the root of the cloned repo:
|
|||||||
|
|
||||||
this will take a while.
|
this will take a while.
|
||||||
|
|
||||||
### Building nginx
|
|
||||||
This will embed an optimized configuration for serving Nextcloud files and PHP-FPM resources. Run this
|
|
||||||
command from the root of the cloned repo:
|
|
||||||
|
|
||||||
`docker compose build nginx`
|
|
||||||
|
|
||||||
### Installing Nextcloud
|
### Installing Nextcloud
|
||||||
|
|
||||||
Run `docker compose up -d`. If something doesn't work try debugging it yourself of open an issue with the php-fpm and nginx logs attached.
|
Run `docker compose up -d`. If something doesn't work try debugging it yourself of open an issue with the php-fpm and nginx logs attached.
|
||||||
@ -88,6 +82,9 @@ Edit `/your/nextcloud/root/nextcloud/config/config.php` and add the following op
|
|||||||
),
|
),
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Editing nginx.conf
|
||||||
|
You may also have to replace `example.com` with your own domain or multiple domains in the nginx.conf file.
|
||||||
|
|
||||||
### Enabling system cron (optional)
|
### Enabling system cron (optional)
|
||||||
Nextcloud must perform background tasks. The best way to do that is to use cron. However, on docker this is not easily doable. Here the host will perform the cronjobs required.
|
Nextcloud must perform background tasks. The best way to do that is to use cron. However, on docker this is not easily doable. Here the host will perform the cronjobs required.
|
||||||
|
|
||||||
|
@ -3,17 +3,14 @@ services:
|
|||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
container_name: nginx-nextcloud
|
container_name: nginx-nextcloud
|
||||||
build: ./nginx
|
image: nginx:latest
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
- 443:443
|
- 443:443
|
||||||
volumes:
|
volumes:
|
||||||
- ${NEXTCLOUD_DIR}:/var/www/html
|
- ${NEXTCLOUD_DIR}:/var/www/html
|
||||||
- ${DATA_DIR}:/data
|
- ${DATA_DIR}:/data
|
||||||
environment:
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
- NEXTCLOUD_PHP_FPM_HOST=${NEXTCLOUD_PHP_FPM_HOST}
|
|
||||||
- NEXTCLOUD_DOMAIN=${NEXTCLOUD_DOMAIN}
|
|
||||||
- NEXTCLOUD_MAX_UPLOAD_SIZE=${NEXTCLOUD_MAX_UPLOAD_SIZE}
|
|
||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -23,10 +20,7 @@ services:
|
|||||||
|
|
||||||
php-fpm-nextcloud:
|
php-fpm-nextcloud:
|
||||||
container_name: php-fpm-nextcloud
|
container_name: php-fpm-nextcloud
|
||||||
build:
|
build: ./php-fpm
|
||||||
context: ./php-fpm
|
|
||||||
tags:
|
|
||||||
- localhost/php-fpm-nextcloud:latest
|
|
||||||
volumes:
|
volumes:
|
||||||
- ${NEXTCLOUD_DIR}:/var/www/html
|
- ${NEXTCLOUD_DIR}:/var/www/html
|
||||||
- ${DATA_DIR}:/data
|
- ${DATA_DIR}:/data
|
||||||
@ -57,25 +51,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
|
||||||
cron-nextcloud:
|
|
||||||
container_name: cron-nextcloud
|
|
||||||
image: localhost/php-fpm-nextcloud:latest
|
|
||||||
restart: unless-stopped
|
|
||||||
command:
|
|
||||||
- bash
|
|
||||||
- -c
|
|
||||||
- "'while true; do php --define apc.enable_cli=1 /var/www/html/cron.php && sleep 300; done'"
|
|
||||||
networks:
|
|
||||||
- nextcloud
|
|
||||||
user: www-data
|
|
||||||
volumes:
|
|
||||||
- ${NEXTCLOUD_DIR}:/var/www/html
|
|
||||||
- ${DATA_DIR}:/data
|
|
||||||
depends_on:
|
|
||||||
- php-fpm-nextcloud
|
|
||||||
- redis-nextcloud
|
|
||||||
- mariadb-nextcloud
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nextcloud:
|
nextcloud:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
@ -2,7 +2,7 @@ events { worker_connections 1024; }
|
|||||||
http {
|
http {
|
||||||
|
|
||||||
upstream php-handler {
|
upstream php-handler {
|
||||||
server ${NEXTCLOUD_PHP_FPM_HOST};
|
server php-fpm-nextcloud:9000;
|
||||||
#server unix:/run/php/php8.2-fpm.sock;
|
#server unix:/run/php/php8.2-fpm.sock;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ http {
|
|||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
# INFO: Set this to your domain
|
# INFO: Set this to your domain
|
||||||
server_name ${NEXTCLOUD_DOMAIN};
|
server_name example.com;
|
||||||
|
|
||||||
# Prevent nginx HTTP Server Detection
|
# Prevent nginx HTTP Server Detection
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
@ -34,7 +34,7 @@ http {
|
|||||||
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" always;
|
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" always;
|
||||||
|
|
||||||
# set max upload size and increase upload timeout:
|
# set max upload size and increase upload timeout:
|
||||||
client_max_body_size ${NEXTCLOUD_MAX_UPLOAD_SIZE};
|
client_max_body_size 512M;
|
||||||
client_body_timeout 300s;
|
client_body_timeout 300s;
|
||||||
fastcgi_buffers 64 4K;
|
fastcgi_buffers 64 4K;
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
FROM docker.io/library/nginx:latest
|
|
||||||
|
|
||||||
ENV NEXTCLOUD_DOMAIN=example.com
|
|
||||||
ENV NEXTCLOUD_PHP_FPM_HOST=php-fpm-nextcloud:9000
|
|
||||||
ENV NEXTCLOUD_MAX_UPLOAD_SIZE=512M
|
|
||||||
|
|
||||||
ADD nginx.conf.template /nginx.conf.template
|
|
||||||
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "-c", "/docker-entrypoint.sh"]
|
|
@ -1,16 +0,0 @@
|
|||||||
#/usr/bin/env bash
|
|
||||||
|
|
||||||
# This implementation is adapted from the solution proposed here:
|
|
||||||
# https://stackoverflow.com/questions/21866477/nginx-use-environment-variables
|
|
||||||
|
|
||||||
# envsubst will take the input and replace all references to environment
|
|
||||||
# variables with their corresponding value. Because nginx uses the same
|
|
||||||
# '$' prefix for its internal variables, we should explicitly define the
|
|
||||||
# variables we want to replace rather than replacing all env vars.
|
|
||||||
envsubst '
|
|
||||||
$NEXTCLOUD_PHP_FPM_HOST
|
|
||||||
$NEXTCLOUD_DOMAIN
|
|
||||||
$NEXTCLOUD_MAX_UPLOAD_SIZE
|
|
||||||
' < /nginx.conf.template > /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
exec nginx -g 'daemon off;'
|
|
Loading…
Reference in New Issue
Block a user