WHAT: Introduces Dockerfiles for development and production, Docker Compose configurations, a Makefile for common tasks, shell scripts for environment setup/teardown, a basic Express API with SQLite integration. WHY: Enables easy setup and deployment of the application using Docker. Provides basic API endpoints for managing purchase items. HOW: - Creates `docker-compose.dev.yml` and `docker-compose.prod.yml` to define services and volumes. - Introduces `Dockerfile.dev` and `Dockerfile.prod` to build container images with necessary dependencies. - Adds `Makefile` with commands for building, running, and managing the application. - Implements shell scripts for simplified Docker environment management. - Sets up Express API with endpoints for CRUD operations on purchase items, using SQLite as the database. - Uses `better-sqlite3` to connect and interact with the SQLite database.
14 lines
378 B
Bash
14 lines
378 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "[Dream-Machine] 停止生产环境"
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
|
ROOT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
|
|
|
|
echo "[步骤] 停止 Docker Compose (生产) (保留数据卷)"
|
|
(cd "$ROOT_DIR/docker" && docker compose -f docker-compose.prod.yml down)
|
|
|
|
echo "[完成] 生产环境已停止。数据库卷 dm_db 已保留。"
|
|
|
|
|