fix: Update Docker configuration for persistent data storage

- Update docker-compose.yml to use latest image marcogll/ap-pos:latest
- Change from bind mount to named volume for better data persistence
- Add proper volumes section to ensure database survives container restarts
- Update README with corrected deployment instructions

This fixes the issue where imported JSON products were lost on container restart.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Marco Gallegos
2025-09-08 19:05:19 -06:00
parent 6e97309323
commit a12ac988eb
2 changed files with 12 additions and 4 deletions

View File

@@ -73,8 +73,12 @@ El sistema está diseñado para ser desplegado fácilmente utilizando Docker y D
# Edita el archivo .env con una clave secreta segura # Edita el archivo .env con una clave secreta segura
``` ```
3. **Construye y levanta** el contenedor: 3. **Levanta** el contenedor:
```bash ```bash
# Usar imagen desde Docker Hub (recomendado para producción)
docker-compose up -d
# O construir localmente (para desarrollo)
docker-compose up -d --build docker-compose up -d --build
``` ```

View File

@@ -1,6 +1,8 @@
version: '3.8'
services: services:
ap-pos: ap-pos:
image: marcogll/ap_pos:1.4.1 image: marcogll/ap-pos:latest
container_name: ap-pos container_name: ap-pos
restart: unless-stopped restart: unless-stopped
ports: ports:
@@ -10,7 +12,7 @@ services:
SESSION_SECRET: ${SESSION_SECRET:-your-very-secret-key-change-it-in-production} SESSION_SECRET: ${SESSION_SECRET:-your-very-secret-key-change-it-in-production}
DB_PATH: /app/data/ap-pos.db DB_PATH: /app/data/ap-pos.db
volumes: volumes:
- ./data:/app/data - ap_pos_data:/app/data
healthcheck: healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3111/login.html"] test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3111/login.html"]
interval: 30s interval: 30s
@@ -18,4 +20,6 @@ services:
retries: 3 retries: 3
start_period: 40s start_period: 40s
# volumes section no longer needed - using direct bind mount volumes:
ap_pos_data:
driver: local