Hello I try to run nextcloud with docker on a arm64(nanopi m4v2 with FriendlyDesktop) system according to the offical nextcloud example
I made some adaptations for the arm system:
First I rebuild the letsencrypt-nginx-proxy-companion so it uses the alpine version for arm architeecture.
For the ngnix-Image I had to made some more adjustments, change Forego and alpine.
ngnix Dockerfile
FROM nginx:1.17.6
LABEL maintainer="Jason Wilder mail@jasonwilder.com"
# Install wget and install/updates certificates
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
wget \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*
# Configure Nginx and apply fix for very long server names
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
&& sed -i 's/worker_processes 1/worker_processes auto/' /etc/nginx/nginx.conf
# Install Forego
RUN wget https://bin.equinox.io/c/ekMN3bCZFUn/forego-stable-linux-arm.tgz \
&& tar -C /usr/local/bin -xvf forego-stable-linux-arm.tgz
RUN chmod u+x /usr/local/bin/forego
ENV DOCKER_GEN_VERSION 0.7.4
# docker-gen-alpine-linux-armhf-0.7.4.tar.gz
RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-alpine-linux-armhf-$DOCKER_GEN_VERSION.tar.gz \
&& tar -C /usr/local/bin -xvzf docker-gen-alpine-linux-armhf-$DOCKER_GEN_VERSION.tar.gz \
&& rm /docker-gen-alpine-linux-armhf-$DOCKER_GEN_VERSION.tar.gz
COPY network_internal.conf /etc/nginx/
COPY . /app/
WORKDIR /app/
ENV DOCKER_HOST unix:///tmp/docker.sock
VOLUME ["/etc/nginx/certs", "/etc/nginx/dhparam"]
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]
I use following yaml file to start the services:
docker-compose.yml
version: '3'
services:
db:
image: postgres:alpine
restart: always
volumes:
- /media/pi/drive1/postgres:/var/lib/postgresql/data
env_file:
- db.env
app:
image: nextcloud:apache
restart: always
volumes:
- /media/pi/drive1/nextcloud:/var/www/html
environment:
- VIRTUAL_HOST="***.myfritz.net"
- LETSENCRYPT_HOST="****.myfritz.net"
- LETSENCRYPT_EMAIL="***@***.de"
- POSTGRES_HOST=db
env_file:
- db.env
depends_on:
- db
networks:
- proxy-tier
- default
proxy:
build: ./proxy
restart: always
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- certs:/etc/nginx/certs:ro
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier
letsencrypt-companion:
image: nginx-companion
restart: always
volumes:
- certs:/etc/nginx/certs
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
depends_on:
- proxy
volumes:
certs:
vhost.d:
html:
networks:
proxy-tier:
After start I get a sadly “This site can’t be reached”
Here are the docker logs:
nginx container
WARNING: /etc/nginx/dhparam/dhparam.pem was not found. A pre-generated dhparam.pem will be used for now while a new one
is being generated in the background. Once the new dhparam.pem is in place, nginx will be reloaded.
forego | starting dockergen.1 on port 5000
forego | starting nginx.1 on port 5100
dockergen.1 | 2020/04/03 15:33:35 Generated '/etc/nginx/conf.d/default.conf' from 3 containers
dockergen.1 | 2020/04/03 15:33:35 Running 'nginx -s reload'
dockergen.1 | 2020/04/03 15:33:35 Error running notify command: nginx -s reload, exit status 1
dockergen.1 | 2020/04/03 15:33:35 Watching docker events
dockergen.1 | 2020/04/03 15:33:35 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2020/04/03 15:33:35 Received event start for container 52166336b198
dockergen.1 | 2020/04/03 15:33:35 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
2020/04/03 15:35:57 [emerg] 70#70: host not found in upstream ""****.myfritz.net"" in /etc/nginx/conf.d/default.conf:79
nginx: [emerg] host not found in upstream ""****.myfritz.net"" in /etc/nginx/conf.d/default.conf:79
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
dhparam generation complete, reloading nginx
nginx.1 | ***.***.*** - - [03/Apr/2020:15:41:03 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 zgrab/0.x" "-"
nginx.1 | ***.***.*** - - [03/Apr/2020:15:48:25 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/**.**.** Safari/537.36 SE 2.X MetaSr 1.0" "-"
nginx.1 | ***.***.*** - - [03/Apr/2020:16:29:26 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" "-"
nginx.1 | ***.***.*** - - [03/Apr/2020:16:29:29 +0000] "GET /robots.txt HTTP/1.1" 404 153 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" "-"
nginx.1 | 2020/04/03 16:29:29 [error] 38#38: *4 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: **.**.**.***, server: localhost, request: "GET /robots.txt HTTP/1.1", host: "**.**.**.***"
nginx.1 | ***.***.*** - - [03/Apr/2020:16:29:29 +0000] "POST /Adminee1a4c5c/Login.php HTTP/1.1" 404 153 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" "-"
nginx.1 | 2020/04/03 16:29:29 [error] 38#38: *4 open() "/usr/share/nginx/html/Adminee1a4c5c/Login.php" failed (2: No such file or directory), client: ***.***.***, server: localhost, request: "POST /Adminee1a4c5c/Login.php HTTP/1.1", host: "**.**.**.***"
nginx.1 | ***.***.*** - - [03/Apr/2020:15:41:03 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 zgrab/0.x" "-"
nginx.1 | ***.***.*** - - [03/Apr/2020:15:48:25 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/**** Safari/537.36 SE 2.X MetaSr 1.0" "-"
nginx.1 | ***.***.*** - - [03/Apr/2020:16:29:26 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" "-"
nginx.1 | ***.***.*** - - [03/Apr/2020:16:29:29 +0000] "GET /robots.txt HTTP/1.1" 404 153 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" "-"
nginx.1 | 2020/04/03 16:29:29 [error] 38#38: *4 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: ***.***.***, server: localhost, request: "GET /robots.txt HTTP/1.1", host: "**.**.**.***"
nginx.1 | ***.***.*** - - [03/Apr/2020:16:29:29 +0000] "POST /Adminee1a4c5c/Login.php HTTP/1.1" 404 153 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" "-"
nginx.1 | 2020/04/03 16:29:29 [error] 38#38: *4 open() "/usr/share/nginx/html/Adminee1a4c5c/Login.php" failed (2: No such file or directory), client: **.**.**, server: localhost, request: "POST /Adminee1a4c5c/Login.php HTTP/1.1", host: "**.**.**.***"
nextcloud container
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.23.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.23.0.3. Set the 'ServerName' directive globally to suppress this message
[Fri Apr 03 15:33:35.756667 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.16 configured -- resuming normal operations
[Fri Apr 03 15:33:35.756936 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
encrypt companion container
Info: Custom Diffie-Hellman group found, generation skipped.
Reloading nginx proxy (79ff3d42cd5bafc0d1653fdbf7e17eafc81210a28b3a9bb2db9a11bf48cdd5eb)...
2020/04/03 15:33:37 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification ''
2020/04/03 15:33:37 Generated '/app/letsencrypt_service_data' from 4 containers
2020/04/03 15:33:37 Running '/app/signal_le_service'
2020/04/03 15:33:37 Watching docker events
2020/04/03 15:33:38 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
/etc/nginx/certs/"*****.myfritz.net" /app
I tried several configurations for VIRTUAL_HOST variable, like host IP, Docker Network IP, Docker Container Name, with/without http/https…
I searched for the issue and found that:
host not found in upstream But that seams ok:
docker network
[
{
"Name": "docker_proxy-tier",
"Id": "c22220a26673f01303d46f806eb9c1092ce5a50998f6bec82c3e56d44cb2cf73",
"Created": "2020-04-03T15:33:28.089811688Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.24.0.0/16",
"Gateway": "172.24.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"403c4e59f04cd233889b4ae49e23e47261e6c5ed7bb3619ed08b2088ebd0e752": {
"Name": "docker_app_1",
"EndpointID": "7f10a1bebdfbe41dcdb7bfaf4be4fb2bb0df20bcadb713d9aef750c54f3cb9f5",
"MacAddress": "02:42:ac:18:00:03",
"IPv4Address": "172.24.0.3/16",
"IPv6Address": ""
},
"52166336b1989ed9707be14692206e0b6d9c9a86b63ae1def10eb18246796bd8": {
"Name": "docker_letsencrypt-companion_1",
"EndpointID": "5caf4b4b979535769a0e5c4bb4f6a8cfb8d4ab818a8059926c1a7dc3681f5feb",
"MacAddress": "02:42:ac:18:00:04",
"IPv4Address": "172.24.0.4/16",
"IPv6Address": ""
},
"79ff3d42cd5bafc0d1653fdbf7e17eafc81210a28b3a9bb2db9a11bf48cdd5eb": {
"Name": "docker_proxy_1",
"EndpointID": "740ce13690e01fc9151f4d5ca607f79990d059388ed5ff70e59e1401a58aeb4e",
"MacAddress": "02:42:ac:18:00:02",
"IPv4Address": "172.24.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "proxy-tier",
"com.docker.compose.project": "docker",
"com.docker.compose.version": "1.25.4"
}
}
]
I don’t have any expirience with nginx and sorry if my question is stupid, thanks for help in advance