参考とした記事
EC-CUBE 3.0系をdockerで動かすときのメモ
https://qiita.com/chihiro-adachi/items/ec610d1f561d3dbcb7eb
環境構築手順
3系をインストール
Terminal
git clone <https://github.com/EC-CUBE/ec-cube3.git>
cd ec-cube3
2.17のdocker関連ファイルを取得
Terminal
(
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
)
各種セット
Terminal
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
sed -i "" 's/image: postgres/&:9/g' docker-compose.pgsql.yml
Dockerfileの修正
以下を追加
RUN sed -i s,deb.debian.org,cloudfront.debian.net/debian-archive,g /etc/apt/sources.list
RUN sed -i 's,security.debian.org,cloudfront.debian.net/debian-archive,g' /etc/apt/sources.list
RUN sed -i '/stretch-updates/d' /etc/apt/sources.list
cf. Dockerfile
ARG GD_OPTIONS="--with-freetype --with-jpeg"
ARG EXT_INSTALL_ARGS="gd zip mysqli pgsql opcache"
ARG APCU="apcu"
ARG FORCE_YES="--force-yes"
# See <https://github.com/debuerreotype/debuerreotype/issues/10>
RUN if [ ! -d /usr/share/man/man1 ]; then mkdir /usr/share/man/man1; fi
RUN if [ ! -d /usr/share/man/man7 ]; then mkdir /usr/share/man/man7; fi
ビルド
※ビルドをする前にDockerを起動してください。
Terminal
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= \\
./
タグ付け
Terminal
docker tag ec-cube2 ghcr.io/ec-cube/ec-cube2-php:${TAG}
起動(pgsql)
Terminal
docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml -f docker-compose.dev.yml up
composer install
※別ターミナルを開く
Terminal
docker exec -it ec-cube3-ec-cube-1 composer install
ブラウザで開く
Terminal
open <https://localhost:4430/>