7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

NextcloudをDockerで構築する

Last updated at Posted at 2023-07-31

目的

フォルダの共有場所を作成する必要が出てきたので、今回はNextcloudを構築する

ディレクトリ構成

  • docker-compose.yml
  • .env

構築

Docker-compose.yml

version: '3.9'
services:
  nextcloud-db:
    container_name: nextcloud-db
    image: mariadb
    restart: always
    volumes:
      - ./nextcloud-db:/var/lib/mysql
    environment:
      - MARIADB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}  # .envファイルに環境変数を設定
      - MARIADB_PASSWORD=${MYSQL_PASSWORD}  # .envファイルに環境変数を設定
      - MARIADB_DATABASE=nextcloud
      - MARIADB_USER=nextcloud

  nextcloud:
    container_name: nextcloud
    image: nextcloud
    ports:
      - 8081:80
    volumes:
      - ./nextcloud:/var/www/html
    restart: always
    environment:
      - MYSQL_HOST=nextcloud-db
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}  # .envファイルに環境変数を設定
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

.env

.env
MYSQL_ROOT_PASSWORD=nextcloud
MYSQL_PASSWORD=nextcloud

起動

$ docker-compose up

確認

ok!
image.png

7
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?