diff --git a/docker/Dockerfile b/docker/Dockerfile index c54b77b0a..a1836158b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,10 +1,11 @@ # https://hub.docker.com/_/nextcloud/ -FROM nextcloud:29-apache +FROM nextcloud:30-apache #FROM ghcr.io/pbek/nextcloud-docker-pre-apache:latest #FROM ghcr.io/digital-blueprint/nextcloud-docker-pre-apache:latest COPY entrypoint.sh / +RUN apt-get update && apt-get install -y sqlite3 RUN deluser www-data RUN useradd -u 1000 -ms /bin/bash www-data RUN usermod -a -G www-data www-data diff --git a/docker/README.md b/docker/README.md index d6344e4c5..28ff1a0a6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -10,6 +10,8 @@ docker compose up Afterward you should be able to open (admin/admin) to log in to your Nextcloud instance. +Press Ctrl+C to stop the container. + ## Check nextcloud.log For debugging, you can show the `nextcloud.log`: @@ -20,6 +22,34 @@ make show-log There also is a [logging web interface](http://localhost:8081/index.php/settings/admin/logging). +## Create shell in docker container + +To check if the container is still running: +```bash +docker ps +``` +It should show something like this: +```bash +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +a1b2c3d4e5f6 nextcloud-news-app "docker-entrypoint.…" 2 hours ago Up 2 hours 0.0.0.0:8081->80/tcp nextcloud-news-app +``` +To open a shell run +``` bash +docker exec -it nextcloud-news-app /bin/bash +``` + +To exit press Ctrl+D + +### Inside the shell + +Use sqlite3 to open the db + +```bash +sqlite3 data/mydb.db +``` + +More on the sqlite3 cli: https://www.sqlite.org/cli.html + ## Tip In case something is broken try to reset the container: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index de1c68ee3..fec54db42 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,6 +2,7 @@ name: nextcloud-news services: app: + container_name: nextcloud-news-app build: . ports: - 8081:80