Docker container for Nextcloud

Geschreven op 18 september 2018 door Philip Vergunst

Put the following code in a file named Dockerfile.

FROM debian:jessie

RUN echo 'deb /' >> /etc/apt/sources.list.d/nextcloud.list
RUN apt-get update
RUN apt-get install -y --force-yes cron nextcloud-client

COPY ./scripts/repo/ /usr/local/bin/
COPY .nextcloudcr /home/woz/.nextcloudcr

RUN adduser --disabled-password --gecos "" woz

RUN mkdir /var/log/nextcloud-client
RUN mkdir /home/woz/nextcloud

RUN echo "* * * * * /usr/local/bin/ /home/woz/.nextcloudcr --logdir /var/log/nextcloud-client" | crontab

CMD cron; tail -f /dev/null

Then create a Docker Compose file named docker-compose.yml in which you should put the following code:

version: "3"

      context: .
      dockerfile: Dockerfile
      - ./files:/home/woz/nextcloud

Lastly create a file named .nextcloudcr and put the following text in it. Replace DAV_URL, DAV_USER and DAV_PASS with your credentials.

local: /home/woz/nextcloud
remote: DAV_URL
username: DAV_USER
password: DAV_PASS

Start your Nextcloud Docker container with the following command:
docker-compose up -d

Reactie toevoegen

Plaats hier uw naam.