this post was submitted on 13 Feb 2025
10 points (91.7% liked)

Self Hosted - Self-hosting your services.

11598 readers
33 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 3 years ago
MODERATORS
 

Password is right in compose and config. Idk what else to do.

you are viewing a single comment's thread
view the rest of the comments
[–] rtxn 3 points 6 days ago* (last edited 6 days ago) (1 children)

My compose.yaml inside...

volumes:
  db:

services:
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    secrets:
      - mysql_root_password
      - mysql_nextcloud_password
    environment:
      - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
      - MYSQL_PASSWORD_FILE=/run/secrets/mysql_nextcloud_password
      - MYSQL_DATABASE=
      - MYSQL_USER=

  nextcloud:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    depends_on:
      - db
    links:
      - db
    volumes:
      - /var/www/html:/var/www/html
      - /srv/data:/srv/data
    secrets:
      - mysql_nextcloud_password
    environment:
      - MYSQL_PASSWORD_FILE=/run/secrets/mysql_nextcloud_password
      - MYSQL_DATABASE=
      - MYSQL_USER=
      - MYSQL_HOST=db

secrets:
  mysql_root_password:
    file: ...
  mysql_nextcloud_password:
    file: ...

If you use the links: element in the nextcloud service, the services listed there will be available using their hostnames. On the Nextcloud setup screen, choose mysql as the database engine, use db as the database host, and enter matching values into the other fields.

[–] [email protected] 1 points 4 days ago

Thanks for sharing!