P
P
Pavel2018-09-04 08:57:12
MySQL
Pavel, 2018-09-04 08:57:12

How to connect owncloud in docker container with external database?

Hello!
I'm trying to run owncloud in a container. If you use the compose file example from the official site ( https://doc.owncloud.org/server/10.0/admin_manual/... where the database in a separate container runs fine.
But I would like to use the database from the MySQl or Postgresql host( Ideally, of course, use postgresql)
The databases are created and open for external connection for both
DBMSs.But in the case of MySQl, it throws errors that the database tables do not exist.I can’t create them all by hand.What could be the problem?
In the case of postgresql, it gives an error that the specified database type is not supported. (I set a variable in the compose file OWNCLOUD_DB_TYPE=postgresql). Maybe something else is called this type? But where to find out? I didn't find it in the official documentation. But at the office The site says about Postgresql support.
Here is the docker-compose.yml code

version: '2.1'

volumes:
  files:
    driver: local
  redis:
    driver: local

services:
  owncloud:
    image: owncloud/server:${OWNCLOUD_VERSION}
    restart: always
    ports:
      - ${HTTPS_PORT}:443
      - ${HTTP_PORT}:80
    depends_on:
      - redis
    environment:
      - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=owncloud
      - OWNCLOUD_DB_HOST=192.168.0.205
      - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
      - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=redis
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - files:/mnt/data

  redis:
    image: webhippie/redis:latest
    restart: always
    environment:
      - REDIS_DATABASES=1
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - redis:/var/lib/redis

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question