diff --git a/conf/redis/redis.conf b/conf/redis/redis.conf index c577e1d..97734a2 100644 --- a/conf/redis/redis.conf +++ b/conf/redis/redis.conf @@ -1,2 +1,16 @@ notify-keyspace-events "Ex" # requirepass "safeu" +save 60 100 +save 900 1 +save 300 10 +stop-writes-on-bgsave-error no +rdbcompression yes +dbfilename dump.rdb + +appendonly no +appendfsync everysec +no-appendfsync-on-rewrite no +auto-aof-rewrite-percentage 100 +auto-aof-rewrite-min-size 64mb + +dir /data diff --git a/deployments/prod-safeu/docker-compose.yml b/deployments/prod-safeu/docker-compose.yml index 50bc10e..4f4a70c 100644 --- a/deployments/prod-safeu/docker-compose.yml +++ b/deployments/prod-safeu/docker-compose.yml @@ -27,12 +27,10 @@ services: environment: - TZ=Asia/Shanghai ports: - # TODO: This port should not be exposed, remove it after finishing the production test. - "8080:8080" networks: - safeu-app-net depends_on: -# - db - safeu-redis restart: on-failure @@ -46,19 +44,33 @@ services: environment: - TZ=Asia/Shanghai ports: - # TODO: This port should not be exposed, remove it after finishing the production test. - "8081:8080" networks: - safeu-app-net depends_on: -# - db + - safeu-redis + restart: on-failure + + safeu3: + build: + context: ../.. + dockerfile: ././build/package/safeu-backend/Dockerfile-compose + volumes: + - ../../log/web2:/go/src/a2os/safeu-backend/log/ + # - ../..:/go/src/a2os/safeu-backend/ + environment: + - TZ=Asia/Shanghai + ports: + - "8082:8080" + networks: + - safeu-app-net + depends_on: - safeu-redis restart: on-failure # db: # environment: # - TZ=Asia/Shanghai -# # TODO: Change a stronger password. # - MYSQL_ROOT_PASSWORD=safeu # - MYSQL_DATABASE=safeu # image: mariadb:10.3 diff --git a/scripts/prod-docker-compose.sh b/scripts/prod-docker-compose.sh index a4b56e7..456f33a 100755 --- a/scripts/prod-docker-compose.sh +++ b/scripts/prod-docker-compose.sh @@ -6,7 +6,7 @@ echo -e "\n Build, up, down, restart, pull, check logs for SafeU production dock if [ "$1" == "up" ] then - mkdir -p ../data/mariadb + mkdir -p ../data sudo docker-compose -f ../deployments/prod-safeu/docker-compose.yml up -d elif [ "$1" == "down" ] @@ -50,7 +50,7 @@ then logs View output from prod containers pull Pull SafeU prod container images restart Restart SafeU prod containers - up Up SafeU prod containers with force recreate and build + up Up SafeU prod containers " else