4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

EC-CUBE 3.0系をdockerで動かすときのメモ

Last updated at Posted at 2023-01-18

3.0.18をDockerで動かすときのメモ

// git clone
git clone https://github.com/EC-CUBE/ec-cube3.git
cd ec-cube3

// 2.17のdocker関連ファイルを取得
(
CURRENT_DIR=$(pwd)
cd /tmp
git clone --depth 1 https://github.com/EC-CUBE/ec-cube2.git
cd ec-cube2
cp -r dockerbuild ${CURRENT_DIR}/
cp Dockerfile ${CURRENT_DIR}/
cp docker-compose.yml ${CURRENT_DIR}/
cp docker-compose.pgsql.yml ${CURRENT_DIR}/
cp docker-compose.mysql.yml ${CURRENT_DIR}/
cp docker-compose.dev.yml ${CURRENT_DIR}/
cp eccube_install.sh ${CURRENT_DIR}/

rm -rf /tmp/ec-cube2
)

// composer1系を利用
sed -i "" 's/composer:2.2/composer:1.10/g' Dockerfile

// インストールは別途行うので不要
sed -i "" 's/.*wait-for-pgsql\.sh/#&/g' docker-compose.pgsql.yml  
sed -i "" 's/.*wait-for-mysql\.sh/#&/g' docker-compose.mysql.yml  

// pgsqlはバージョン9を利用
sed -i "" 's/image: postgres/&:9/g' docker-compose.pgsql.yml

// ビルド
export TAG=7.0-apache
docker build -t ec-cube2 --no-cache --pull \
--build-arg TAG=${TAG} \
--build-arg GD_OPTIONS="--with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include" \
--build-arg EXT_INSTALL_ARGS="gd zip mysqli pgsql opcache pdo_pgsql pdo_mysql" \
--build-arg APCU=apcu \
--build-arg FORCE_YES= \
./

// タグ付け
docker tag ec-cube2 ghcr.io/ec-cube/ec-cube2-php:${TAG}

// 起動(pgsql)
docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml -f docker-compose.dev.yml up

// 起動(mysql)
docker-compose -f docker-compose.yml -f docker-compose.mysql.yml -f docker-compose.dev.yml up

// composer install
docker exec -it ec-cube3-ec-cube-1 composer install 

// ブラウザで開く
open https://localhost:4430/

トラブルシュート

pgsqlでFATAL: "/var/lib/postgresql/data" is not a valid data directoryのエラーが出る場合は以下を参照

4
2
1

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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?