Skip to content

Commit

Permalink
change: data volume to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
datlt4 committed Nov 12, 2024
1 parent 2804b31 commit 3a45246
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
TARGET=20240413_081059

UPLOAD_VOLUME_PATH=<upload_volume>
DB_VOLUME_PATH=<fhost_db_volume>
BACKUP_PATH=<backup>

# Config Flask app
FLASK_APP=fhost
FLASK_ENV=production
Expand Down
17 changes: 8 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ services:
- .env
restart: always
volumes:
- upload_volume:/files
# - ./instance:/python-docker/instance
- fhost_db_volume:/python-docker/fhost_db.sql
- ${UPLOAD_VOLUME_PATH}:/files
- ${DB_VOLUME_PATH}:/python-docker/fhost_db.sql
networks:
- zxz_nginx_net
# ports:
Expand Down Expand Up @@ -52,9 +51,9 @@ services:
environment:
- TARGET=${TARGET}
volumes:
- upload_volume:/upload_data
- fhost_db_volume:/fhost_db_data
- ./backup:/backup
- ${UPLOAD_VOLUME_PATH}:/upload_data
- ${DB_VOLUME_PATH}:/fhost_db_data
- ${BACKUP_PATH}:/backup
command: >-
sh -c "
cd /upload_data && tar -czf /backup/upload_data_$${TARGET}.tar.gz *;
Expand All @@ -66,9 +65,9 @@ services:
environment:
- TARGET=${TARGET}
volumes:
- upload_volume:/upload_data
- fhost_db_volume:/fhost_db_data
- ./backup:/backup
- ${UPLOAD_VOLUME_PATH}:/upload_data
- ${DB_VOLUME_PATH}:/fhost_db_data
- ${BACKUP_PATH}:/backup
command: >-
sh -c "
rm -rf /upload_data/* /upload_data/..?* /upload_data/.[!.]*;
Expand Down

0 comments on commit 3a45246

Please sign in to comment.