due the difficult update process of my locally installed Nextcloud instance I'd like to move it to a container. My personal challenge here is that I can't use the often described way with Let's encrypt as the service is not supposed to be available from outside.
Starting with the documentation on Docker Hub for the Nextcloud package https://hub.docker.com/_/nextcloud I fiddled through other tutorials to remove the let's encrypt part. Now I have this docker-compose file:
Code: Select all
version: '3'
services:
proxy:
image: jwilder/nginx-proxy
container_name: nextcloud-proxy
networks:
- extern
ports:
- 8009:80
- 8010:443
volumes:
- ./proxy/conf.d:/etc/nginx/conf.d:rw
- ./proxy/vhost.d:/etc/nginx/vhost.d:rw
- ./proxy/html:/usr/share/nginx/html:rw
- ./proxy/certs:/etc/nginx/certs:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: unless-stopped
db:
image: mariadb
container_name: nextcloud-mariadb
networks:
- extern
volumes:
- db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_ROOT_PASSWORD=mysecret
- MYSQL_PASSWORD=anothersecret
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
restart: unless-stopped
app:
image: nextcloud:latest
container_name: nextcloud-app
networks:
- extern
depends_on:
- proxy
- db
volumes:
- nextcloud:/var/www/html
- ./app/config:/var/www/html/config
- ./app/data:/var/www/html/data
- ./app/themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
environment:
- VIRTUAL_HOST=myhostname
- VIRTUAL_PROTO=https
restart: unless-stopped
volumes:
proxy:
nextcloud:
db:
networks:
extern:
A docker-compose up gives me that log:
Code: Select all
Starting nextcloud-mariadb ... done
Starting nextcloud-proxy ... done
Starting nextcloud-app ... done
Attaching to nextcloud-mariadb, nextcloud-proxy, nextcloud-app
nextcloud-proxy | Custom dhparam.pem file found, generation skipped
nextcloud-mariadb | 2020-08-25 15:55:55+02:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
nextcloud-mariadb | 2020-08-25 15:55:56+02:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
nextcloud-mariadb | 2020-08-25 15:55:56+02:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.4+maria~focal started.
nextcloud-proxy | forego | starting dockergen.1 on port 5000
nextcloud-proxy | forego | starting nginx.1 on port 5100
nextcloud-proxy | dockergen.1 | 2020/08/25 15:55:55 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
nextcloud-proxy | dockergen.1 | 2020/08/25 15:55:55 Watching docker events
nextcloud-proxy | dockergen.1 | 2020/08/25 15:55:56 Generated '/etc/nginx/conf.d/default.conf' from 3 containers
nextcloud-proxy | dockergen.1 | 2020/08/25 15:55:56 Running 'nginx -s reload'
nextcloud-proxy | dockergen.1 | 2020/08/25 15:55:56 Received event start for container 096e65a93d87
nextcloud-proxy | dockergen.1 | 2020/08/25 15:55:56 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
nextcloud-app | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
nextcloud-app | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
nextcloud-app | [Tue Aug 25 15:55:56.533999 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.7 configured -- resuming normal operations
nextcloud-app | [Tue Aug 25 15:55:56.534040 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] mysqld (mysqld 10.5.4-MariaDB-1:10.5.4+maria~focal) starting as process 1 ...
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Using Linux native AIO
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Uses event mutexes
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Number of pools: 1
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Completed initialization of buffer pool
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: 128 rollback segments are active.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Creating shared tablespace for temporary tables
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: 10.5.4 started; log sequence number 45213; transaction id 21
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] Plugin 'FEEDBACK' is disabled.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] InnoDB: Buffer pool(s) load completed at 200825 15:55:56
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] Server socket created on IP: '::'.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Warning] 'user' entry 'root@5e136b69b0e5' ignored in --skip-name-resolve mode.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Warning] 'user' entry '@5e136b69b0e5' ignored in --skip-name-resolve mode.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Warning] 'proxies_priv' entry '@% root@5e136b69b0e5' ignored in --skip-name-resolve mode.
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] Reading of all Master_info entries succeeded
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] Added new Master_info '' to hash table
nextcloud-mariadb | 2020-08-25 15:55:56 0 [Note] mysqld: ready for connections.
nextcloud-mariadb | Version: '10.5.4-MariaDB-1:10.5.4+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Do you have an idea how to solve the issue? This is my first attempt to use docker so please mercy if the approach is too strange.
Thx, Piotrusch