v1.12.27 NAS 실행 yaml 및 명시적 이미지 빌드 분리
This commit is contained in:
22
scripts/build-production-image.sh
Normal file
22
scripts/build-production-image.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
APP_SERVICE=${APP_SERVICE:-sori-studio}
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if [ -n "${ENV_FILE:-}" ]; then
|
||||
COMPOSE_ENV_FILE=$ENV_FILE
|
||||
elif [ -r .env.production ]; then
|
||||
COMPOSE_ENV_FILE=.env.production
|
||||
else
|
||||
printf '%s\n' '운영 환경 파일이 없습니다. .env.production 또는 ENV_FILE을 지정하세요.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -r "$COMPOSE_ENV_FILE" ]; then
|
||||
printf '%s\n' '지정한 환경 파일을 읽을 수 없습니다.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec docker compose -f "$ROOT_DIR/docker-compose.build.yml" --env-file "$COMPOSE_ENV_FILE" build "$APP_SERVICE"
|
||||
Reference in New Issue
Block a user