5 Commits

Author SHA1 Message Date
이태훈
577f138533 fix: 위치보기 수정 (도면 오버플로우 제한 및 API 호출 경로 정상화)
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 18s
2026-06-22 13:58:01 +09:00
이태훈
237ac9ee25 fix: 위치보기 수정 (도면 오버플로우 제한 및 API 호출 경로 정상화) 2026-06-22 13:56:52 +09:00
이태훈
aacd2fe7db fix: copy map_editor.html to docker builder stage
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 17s
ITAM Docker Build Check / docker-build-check (push) Successful in 21s
2026-06-22 11:46:26 +09:00
이태훈
90403a1acd fix: comment out obsolete COPY img in Dockerfile.frontend.prod 2026-06-22 11:42:42 +09:00
이태훈
6a76f6968b fix: convert scripts/backup.sh line endings from CRLF to LF 2026-06-22 11:36:50 +09:00
5 changed files with 1742 additions and 1737 deletions

View File

@@ -14,7 +14,7 @@ RUN npm ci
# Copy source code
COPY src ./src
COPY public ./public
COPY index.html ./
COPY index.html map_editor.html ./
# Build application
RUN npm run build
@@ -35,8 +35,8 @@ WORKDIR /usr/share/nginx/html
# Copy built assets from builder
COPY --from=builder /app/dist .
# Copy static image assets referenced by literal /img/... paths
COPY img ./img
# Copy static image assets referenced by literal /img/... paths (Obsolete: img folder is now public/img and copied via dist)
# COPY img ./img
# Copy root-level logo asset referenced directly by index.html
# COPY ["image 92.png", "./image 92.png"]

View File

@@ -1,125 +1,125 @@
#!/usr/bin/env sh
set -eu
COMMAND="${1:-help}"
ENV_FILE="${ENV_FILE:-.env}"
BACKUP_ROOT="${BACKUP_ROOT:-backups}"
RETENTION_DAYS="${RETENTION_DAYS:-14}"
TIMESTAMP="${BACKUP_TIMESTAMP:-$(date +%Y%m%d_%H%M%S)}"
log() {
printf '[backup] %s\n' "$*"
}
fail() {
printf '[backup] %s\n' "$*" >&2
exit 1
}
require_command() {
command -v "$1" >/dev/null 2>&1 || fail "Required command not found: $1"
}
has_command() {
command -v "$1" >/dev/null 2>&1
}
load_env() {
[ -f "$ENV_FILE" ] || fail "Env file not found: $ENV_FILE"
case "$ENV_FILE" in
*/*) env_path="$ENV_FILE" ;;
*) env_path="./$ENV_FILE" ;;
esac
set -a
# shellcheck disable=SC1090
. "$env_path"
set +a
: "${DB_HOST:?DB_HOST is required in $ENV_FILE}"
: "${DB_PORT:=3306}"
: "${DB_USER:?DB_USER is required in $ENV_FILE}"
: "${DB_PASS:?DB_PASS is required in $ENV_FILE}"
: "${DB_NAME:?DB_NAME is required in $ENV_FILE}"
}
db_dump() {
require_command gzip
load_env
mkdir -p "$BACKUP_ROOT/db"
output_path="$BACKUP_ROOT/db/${DB_NAME}_${TIMESTAMP}.sql.gz"
log "Creating DB dump: $output_path"
if has_command mysqldump; then
MYSQL_PWD="$DB_PASS" mysqldump \
--host="$DB_HOST" \
--port="$DB_PORT" \
--user="$DB_USER" \
--single-transaction \
--quick \
--routines \
--triggers \
"$DB_NAME" | gzip > "$output_path"
elif has_command docker; then
docker exec itam-backend sh -lc "MYSQL_PWD=\"$DB_PASS\" exec mysqldump --host=\"$DB_HOST\" --port=\"$DB_PORT\" --user=\"$DB_USER\" --single-transaction --quick --routines --triggers \"$DB_NAME\"" | gzip > "$output_path"
else
fail "Required command not found: mysqldump (and docker fallback unavailable)"
fi
log "DB dump completed: $output_path"
}
files_backup() {
require_command tar
mkdir -p "$BACKUP_ROOT/files"
archive_path="$BACKUP_ROOT/files/runtime_${TIMESTAMP}.tar.gz"
set --
[ -f "$ENV_FILE" ] && set -- "$@" "$ENV_FILE"
[ -d "uploads" ] && set -- "$@" "uploads"
[ -f "map_config.json" ] && set -- "$@" "map_config.json"
[ "$#" -gt 0 ] || fail "No runtime files found to archive"
log "Creating runtime archive: $archive_path"
tar -czf "$archive_path" "$@"
log "Runtime archive completed: $archive_path"
}
cleanup_backups() {
require_command find
[ -d "$BACKUP_ROOT" ] || {
log "Backup root does not exist, skipping cleanup: $BACKUP_ROOT"
return 0
}
log "Deleting backup files older than ${RETENTION_DAYS} days from $BACKUP_ROOT"
find "$BACKUP_ROOT" -type f -mtime "+$RETENTION_DAYS" -print -delete
}
case "$COMMAND" in
db)
db_dump
;;
files)
files_backup
;;
full)
db_dump
files_backup
;;
cleanup)
cleanup_backups
;;
help|--help|-h)
log "Commands: db | files | full | cleanup"
;;
*)
fail "Unknown command: $COMMAND"
;;
#!/usr/bin/env sh
set -eu
COMMAND="${1:-help}"
ENV_FILE="${ENV_FILE:-.env}"
BACKUP_ROOT="${BACKUP_ROOT:-backups}"
RETENTION_DAYS="${RETENTION_DAYS:-14}"
TIMESTAMP="${BACKUP_TIMESTAMP:-$(date +%Y%m%d_%H%M%S)}"
log() {
printf '[backup] %s\n' "$*"
}
fail() {
printf '[backup] %s\n' "$*" >&2
exit 1
}
require_command() {
command -v "$1" >/dev/null 2>&1 || fail "Required command not found: $1"
}
has_command() {
command -v "$1" >/dev/null 2>&1
}
load_env() {
[ -f "$ENV_FILE" ] || fail "Env file not found: $ENV_FILE"
case "$ENV_FILE" in
*/*) env_path="$ENV_FILE" ;;
*) env_path="./$ENV_FILE" ;;
esac
set -a
# shellcheck disable=SC1090
. "$env_path"
set +a
: "${DB_HOST:?DB_HOST is required in $ENV_FILE}"
: "${DB_PORT:=3306}"
: "${DB_USER:?DB_USER is required in $ENV_FILE}"
: "${DB_PASS:?DB_PASS is required in $ENV_FILE}"
: "${DB_NAME:?DB_NAME is required in $ENV_FILE}"
}
db_dump() {
require_command gzip
load_env
mkdir -p "$BACKUP_ROOT/db"
output_path="$BACKUP_ROOT/db/${DB_NAME}_${TIMESTAMP}.sql.gz"
log "Creating DB dump: $output_path"
if has_command mysqldump; then
MYSQL_PWD="$DB_PASS" mysqldump \
--host="$DB_HOST" \
--port="$DB_PORT" \
--user="$DB_USER" \
--single-transaction \
--quick \
--routines \
--triggers \
"$DB_NAME" | gzip > "$output_path"
elif has_command docker; then
docker exec itam-backend sh -lc "MYSQL_PWD=\"$DB_PASS\" exec mysqldump --host=\"$DB_HOST\" --port=\"$DB_PORT\" --user=\"$DB_USER\" --single-transaction --quick --routines --triggers \"$DB_NAME\"" | gzip > "$output_path"
else
fail "Required command not found: mysqldump (and docker fallback unavailable)"
fi
log "DB dump completed: $output_path"
}
files_backup() {
require_command tar
mkdir -p "$BACKUP_ROOT/files"
archive_path="$BACKUP_ROOT/files/runtime_${TIMESTAMP}.tar.gz"
set --
[ -f "$ENV_FILE" ] && set -- "$@" "$ENV_FILE"
[ -d "uploads" ] && set -- "$@" "uploads"
[ -f "map_config.json" ] && set -- "$@" "map_config.json"
[ "$#" -gt 0 ] || fail "No runtime files found to archive"
log "Creating runtime archive: $archive_path"
tar -czf "$archive_path" "$@"
log "Runtime archive completed: $archive_path"
}
cleanup_backups() {
require_command find
[ -d "$BACKUP_ROOT" ] || {
log "Backup root does not exist, skipping cleanup: $BACKUP_ROOT"
return 0
}
log "Deleting backup files older than ${RETENTION_DAYS} days from $BACKUP_ROOT"
find "$BACKUP_ROOT" -type f -mtime "+$RETENTION_DAYS" -print -delete
}
case "$COMMAND" in
db)
db_dump
;;
files)
files_backup
;;
full)
db_dump
files_backup
;;
cleanup)
cleanup_backups
;;
help|--help|-h)
log "Commands: db | files | full | cleanup"
;;
*)
fail "Unknown command: $COMMAND"
;;
esac

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,29 +1,29 @@
import { defineConfig } from 'vite';
import { resolve } from 'path';
const proxyTarget = process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:3000';
export default defineConfig({
server: {
port: 8080,
host: true, // Listen on all local IPs
proxy: {
'/api': {
target: proxyTarget,
changeOrigin: true,
},
'/uploads': {
target: proxyTarget,
changeOrigin: true,
}
}
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
map_editor: resolve(__dirname, 'map_editor.html'),
}
}
}
});
import { defineConfig } from 'vite';
import { resolve } from 'path';
const proxyTarget = process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:3000';
export default defineConfig({
server: {
port: 8080,
host: true, // Listen on all local IPs
proxy: {
'/api': {
target: proxyTarget,
changeOrigin: true,
},
'/uploads': {
target: proxyTarget,
changeOrigin: true,
}
}
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
map_editor: resolve(__dirname, 'map_editor.html'),
}
}
}
});