Bake data files into Docker image
Docker Build / Build Docker image (push) Successful in 7s

This commit is contained in:
unknown
2026-06-10 12:59:28 +09:00
parent edde4644e1
commit 13fd61b571
4 changed files with 15 additions and 9 deletions
+2 -1
View File
@@ -16,11 +16,12 @@ __pycache__/
.pytest_cache/ .pytest_cache/
.mypy_cache/ .mypy_cache/
data/
backend/instance/ backend/instance/
*.log *.log
*.zip *.zip
*.XLSM *.XLSM
*.xlsx *.xlsx
!data/**/*.XLSM
!data/**/*.xlsx
sam.txt sam.txt
+10 -6
View File
@@ -40,7 +40,6 @@ docker run --rm --network host `
-e FLASK_PORT=6050 ` -e FLASK_PORT=6050 `
-e APP_DATA_DIR=/app/data ` -e APP_DATA_DIR=/app/data `
-e AUTO_BOOTSTRAP_DB=true ` -e AUTO_BOOTSTRAP_DB=true `
-v ${PWD}/data:/app/data `
-v ${PWD}/backend/instance:/app/backend/instance ` -v ${PWD}/backend/instance:/app/backend/instance `
gitea.mouse84.com/kim.kanghee/idrac-info:latest gitea.mouse84.com/kim.kanghee/idrac-info:latest
``` ```
@@ -80,15 +79,18 @@ docker compose logs -f idrac-info
## Persistent Data ## Persistent Data
The compose file mounts local directories into the container: The image includes the committed `data` directory, including scripts and
server-list files, so the default compose file does not mount `./data` over
`/app/data`.
The compose file only mounts the Flask instance directory:
```text ```text
./data -> /app/data
./backend/instance -> /app/backend/instance ./backend/instance -> /app/backend/instance
``` ```
This preserves uploads, generated files, logs, backups, scripts, repositories, This preserves the default SQLite database and other instance files across
and the default SQLite database across container rebuilds. container restarts.
## Environment ## Environment
@@ -119,11 +121,13 @@ TELEGRAM_CHAT_ID=
## Notes ## Notes
The image is based on Ubuntu 24.04 and installs Dell iDRAC Tools from the local The image is based on Ubuntu 24.04 and installs Dell iDRAC Tools from the local
`iDRACTools` directory during image build: `iDRACTools` directory during image build. It also copies the committed `data`
directory into `/app/data` during image build:
```text ```text
iDRACTools/racadm/UBUNTU24/x86_64/*.deb iDRACTools/racadm/UBUNTU24/x86_64/*.deb
iDRACTools/ipmitool/UBUNTU24_x86_64/*.deb iDRACTools/ipmitool/UBUNTU24_x86_64/*.deb
data/ -> /app/data
``` ```
`racadm` is expected on: `racadm` is expected on:
+3 -1
View File
@@ -54,8 +54,10 @@ RUN pip install --upgrade pip \
COPY app.py config.py ./ COPY app.py config.py ./
COPY backend ./backend COPY backend ./backend
COPY migrations ./migrations COPY migrations ./migrations
COPY data ./data
RUN mkdir -p /app/data /app/backend/instance RUN mkdir -p /app/data /app/backend/instance \
&& find /app/data -type f \( -name "*.sh" -o -name "*.py" \) -exec chmod +x {} \;
EXPOSE 6050 EXPOSE 6050
-1
View File
@@ -19,6 +19,5 @@ services:
TELEGRAM_BOT_TOKEN: "${TELEGRAM_BOT_TOKEN:-}" TELEGRAM_BOT_TOKEN: "${TELEGRAM_BOT_TOKEN:-}"
TELEGRAM_CHAT_ID: "${TELEGRAM_CHAT_ID:-}" TELEGRAM_CHAT_ID: "${TELEGRAM_CHAT_ID:-}"
volumes: volumes:
- ./data:/app/data
- ./backend/instance:/app/backend/instance - ./backend/instance:/app/backend/instance
restart: unless-stopped restart: unless-stopped