0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ラズパイでDockerでWordpress環境を作る

Last updated at Posted at 2024-10-25

概要

Raspberry Pi OS(64bit)の環境で以下の記事のこと(感謝)をやりたい。

そのままやってみるとArm64環境のため上手く行かなかったので修正したメモです。

内容

記事のdocker-compose.ymlのimageにplatform: linux/arm64を指定するだけでは上手く行きませんでした。

以下に修正をしました。

主な修正は、
databaseのイメージを以下に変更。

image: hypriot/rpi-mysql

Wordpressのイメージに以下を指定。

platform: linux/arm64
image: wordpress:latest

wordmoveのイメージに以下を指定と変更。

platform: linux/arm64
image: bitstudios001/wordmove

以下、全文。

docker-compose.yml(修正後)
services:
    database:
        image: hypriot/rpi-mysql
        command:
            - "--character-set-server=utf8"
            - "--collation-server=utf8_unicode_ci"
        ports:
            - "${LOCAL_DB_PORT}:3306"
        restart: on-failure:5
        container_name: "${PRODUCTION_NAME}_db"
        environment:
            MYSQL_USER: wordpress
            MYSQL_DATABASE: wordpress
            MYSQL_PASSWORD: wordpress
            MYSQL_ROOT_PASSWORD: wordpress
    wordpress:
        depends_on:
            - database
        platform: linux/arm64
        image: wordpress:latest
        container_name: "${PRODUCTION_NAME}_wordpress"
        ports:
            - "${LOCAL_SERVER_PORT}:80"
        restart: on-failure:5
        volumes:
            - ./public:/var/www/html
        environment:
            WORDPRESS_DB_HOST: database:3306
            WORDPRESS_DB_NAME: wordpress
            WORDPRESS_DB_USER: wordpress
            WORDPRESS_DB_PASSWORD: wordpress
    wordmove:
        tty: true
        depends_on:
            - wordpress
        platform: linux/arm64
        image: bitstudios001/wordmove
        restart: on-failure:5
        container_name: "${PRODUCTION_NAME}_wordmove"
        volumes:
            - ./config:/home/
            - ./public:/var/www/html
            - ~/.ssh:/home/.ssh 
        environment:
            LOCAL_SERVER_PORT: "${LOCAL_SERVER_PORT}"
            PRODUCTION_URL: "${PRODUCTION_URL}"
            PRODUCTION_DIR_PATH: "${PRODUCTION_DIR_PATH}"
            PRODUCTION_DB_NAME: "${PRODUCTION_DB_NAME}"
            PRODUCTION_DB_USER: "${PRODUCTION_DB_USER}"
            PRODUCTION_DB_PASSWORD: "${PRODUCTION_DB_PASSWORD}"
            PRODUCTION_DB_HOST: "${PRODUCTION_DB_HOST}"
            PRODUCTION_DB_PORT: "${PRODUCTION_DB_PORT}"
            PRODUCTION_SSH_HOST: "${PRODUCTION_SSH_HOST}"
            PRODUCTION_SSH_USER: "${PRODUCTION_SSH_USER}"
            PRODUCTION_SSH_PORT: "${PRODUCTION_SSH_PORT}"

ちなみに修正前はWordmoveの立ち上げで以下のエラーがありました(こうした原因のエラーによくあるらしいので記載)。

exec "/bin/mount-ssh.sh": exec format error

ちなみにこちらの問題かもしれないけれどed25519の秘密鍵をssh-addしてもログインできなかったので秘密鍵をrsaで作り直しました。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?