Last active
February 23, 2023 10:08
-
-
Save mistymagich/e211871a5ee9aebdf53f9245c694bea2 to your computer and use it in GitHub Desktop.
オープンソースERPのiDempiereの日本商習慣対応ディストリビューションJPiere9をDocker Composeで動かしてみる https://mistymagich.wordpress.com/2023/02/21/%e3%82%aa%e3%83%bc%e3%83%97%e3%83%b3%e3%82%bd%e3%83%bc%e3%82%b9-erp-%e3%81%ae-idempiere-%e3%81%ae%e6%97%a5%e6%9c%ac%e5%95%86%e7%bf%92%e6%85%a3%e5%af%be%e5%bf%9c%e3%83%87%e3%82%a3%e3%82%b9%e3%83%88/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
idempiere: | |
build: . | |
volumes: | |
- idempiere_config:/opt/idempiere/configuration | |
- idempiere_plugins:/opt/idempiere/plugins | |
environment: | |
- TZ=Asia/Tokyo | |
ports: | |
- 8080:8080 | |
- 8443:8443 | |
- 12612:12612 | |
depends_on: | |
- postgres | |
postgres: | |
image: postgres:12 | |
volumes: | |
- idempiere_data:/var/lib/postgresql/data | |
environment: | |
- TZ=Asia/Tokyo | |
- POSTGRES_PASSWORD=postgres | |
ports: | |
- 5432:5432 | |
volumes: | |
idempiere_data: | |
idempiere_plugins: | |
idempiere_config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM idempiereofficial/idempiere:9 | |
# JPiere9のインストールパッケージ | |
ENV JPIERE_BUILD https://osdn.net/frs/redir.php?m=nchc&f=jpiere%2F77250%2FJPiereServer9.Linux.x86_64.zip | |
# JPiere9のダンプファイル | |
ENV JPIERE_DUMPFILE https://osdn.net/frs/redir.php?m=rwthaachen&f=jpiere%2F77250%2FExpDat.jar | |
# JPiere9のインストールパッケージをダウンロードして既存のiDempiereと置き換える | |
RUN wget -q --no-check-certificate "$JPIERE_BUILD" -O /tmp/JPiereServer9.Linux.x86_64.zip && \ | |
echo "Hash: $(md5sum /tmp/JPiereServer9.Linux.x86_64.zip)" > "$IDEMPIERE_HOME/MD5SUMS" && \ | |
echo "Date: $(date)" >> "$IDEMPIERE_HOME/MD5SUMS" && \ | |
unzip -q -o /tmp/JPiereServer9.Linux.x86_64.zip -d /opt && \ | |
# 元のDockerfileでコピーされたファイルをJPiere側に移す | |
cp "$IDEMPIERE_HOME/docker-entrypoint.sh" /opt/jpiere-server && \ | |
cp "$IDEMPIERE_HOME/idempiere-server.sh" /opt/jpiere-server && \ | |
cp "$IDEMPIERE_HOME/MD5SUMS" /opt/jpiere-server && \ | |
# 置き換え | |
rm -rf "$IDEMPIERE_HOME" && mv /opt/jpiere-server "$IDEMPIERE_HOME" && \ | |
# シェルスクリプトの改行コードをLFにし、実行権限を付加 | |
find "$IDEMPIERE_HOME" -name "*.sh" -exec sed -i -e 's/\r//g' {} \; && \ | |
find "$IDEMPIERE_HOME" -name "*.sh" -exec chmod +x {} \; && \ | |
chmod 777 "$IDEMPIERE_HOME/idempiere" && \ | |
# ダウンロードファイル削除 | |
rm -f /tmp/JPiereServer9.Linux.x86_64.zip | |
# JPiere9のダンプファイルをダウンロードし、DBインポートスクリプト内でJPiere9のダンプファイルをインポートするようにする | |
RUN wget -q --no-check-certificate "$JPIERE_DUMPFILE" -O "$IDEMPIERE_HOME/data/seed/ExpDat.jar" && \ | |
sed -i -e "s#jar xvf Adempiere\${SUFFIX}.jar#jar xvf ExpDat.jar\nmv \$IDEMPIERE_HOME/data/seed/ExpDat.dmp \$IDEMPIERE_HOME/data/seed/Adempiere\${SUFFIX}.dmp#" \ | |
"$IDEMPIERE_HOME/utils/RUN_ImportIdempiere.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment