mirror of
https://github.com/marcogll/ap_pos.git
synced 2026-01-13 13:15:16 +00:00
fix: Improve Docker data persistence for Coolify deployments
- Update docker-compose.yml to use latest image tag - Add DB_PATH environment variable for explicit database location - Configure bind mount for better data persistence in Coolify - Add VOLUME directive in Dockerfile for data directory - Ensure database survives container updates and restarts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -22,9 +22,12 @@ RUN mkdir -p /app/data && \
|
|||||||
chown -R app:app /app
|
chown -R app:app /app
|
||||||
USER app
|
USER app
|
||||||
|
|
||||||
# 8. Exponer el puerto
|
# 8. Crear volumen para persistencia de datos
|
||||||
|
VOLUME ["/app/data"]
|
||||||
|
|
||||||
|
# 9. Exponer el puerto
|
||||||
EXPOSE 3111
|
EXPOSE 3111
|
||||||
|
|
||||||
# 9. Comando de inicio
|
# 10. Comando de inicio
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
ap-pos:
|
ap-pos:
|
||||||
image: marcogll/ap_pos:1.3.1
|
image: marcogll/ap_pos:latest
|
||||||
container_name: ap-pos
|
container_name: ap-pos
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
@@ -8,6 +8,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
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
|
||||||
volumes:
|
volumes:
|
||||||
- ap_pos_data:/app/data
|
- ap_pos_data:/app/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -20,3 +21,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
ap_pos_data:
|
ap_pos_data:
|
||||||
driver: local
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: none
|
||||||
|
o: bind
|
||||||
|
device: ./data
|
||||||
|
|||||||
Reference in New Issue
Block a user