6
0
Эх сурвалжийг харах

some config and docker changes

Dimitri Korsch 3 жил өмнө
parent
commit
6ebef7bd24
3 өөрчлөгдсөн 16 нэмэгдсэн , 2 устгасан
  1. 5 0
      .dockerignore
  2. 7 0
      Makefile
  3. 4 2
      docker-compose.yml

+ 5 - 0
.dockerignore

@@ -1,11 +1,16 @@
 env/
 venv/
 webui/node_modules/
+frontend/node_modules/
+db.backups/
 projects/
 htmlcov/
 labels/
+labels.ammod/
 models/
+models.ammod/
 tests/
+notebooks/
 
 *.sqlite
 *.sqlite-journal

+ 7 - 0
Makefile

@@ -2,6 +2,10 @@
 UID := $(shell id -u)
 GID := $(shell id -g)
 
+today := $(shell date +%Y-%m-%d)
+
+DB_BACKUPS := db.backups
+
 export UID
 export GID
 
@@ -31,6 +35,9 @@ build_docker:
 		--tag pycs:latest \
 		--build-arg UID=${UID} \
 		--build-arg GID=${GID}
+backup_db:
+	@mkdir -p ${DB_BACKUPS}
+	cp db/data.sqlite3 ${DB_BACKUPS}/data.${today}.sqlite3
 
 run_docker: build_docker
 	@mkdir -p projects db external_data

+ 4 - 2
docker-compose.yml

@@ -12,11 +12,12 @@ services:
       - ${PORT:-5000}:5000
 
     volumes:
-      - ./models:/pycs/models
-      - ./labels:/pycs/labels
+      - ./models.ammod:/pycs/models
+      - ./labels.ammod:/pycs/labels
       - ./projects:/pycs/projects
       - ./db:/pycs/db
       - ./settings.json:/pycs/settings.json
+      - ./.htpasswd:/pycs/.htpasswd
       - ./external_data:/data
 
     depends_on:
@@ -31,3 +32,4 @@ services:
     volumes:
       - ./db:/pycs/db
       - ./settings.json:/pycs/settings.json
+      - ./.htpasswd:/pycs/.htpasswd