来自postgres的数据神秘地被删除

时间:2019-04-26 18:28:37

标签: django postgresql docker-compose cookiecutter-django

我正在将cookiecutter-django(https://github.com/pydanny/cookiecutter-django)用于我的一个实时项目。从最近几天开始,我观察到数据库数据被随机删除。我检查了日志,但一无所获。我不知道如何解决该问题。会非常感谢任何指导。我正在使用与Traefik,Postgres,Redis和celery和django的docker设置。该代码部署在Digital Ocean Bucket上。只有我可以访问该存储桶(排除任何人这样做的可能性)

version: '3'

volumes:
  production_postgres_data: {}
  production_postgres_data_backups: {}
  production_traefik: {}

services:
  django: &django
    build:
      context: .
      dockerfile: ./compose/production/django/Dockerfile
    image: fancy_tsunami_production_django
    depends_on:
      - postgres
      - redis
    env_file:
      - ./.envs/.production/.django
      - ./.envs/.production/.postgres
    command: /start

  postgres:
    build:
      context: .
      dockerfile: ./compose/production/postgres/Dockerfile
    image: fancy_tsunami_production_postgres
    volumes:
      - production_postgres_data:/var/lib/postgresql/data
      - production_postgres_data_backups:/backups
    env_file:
      - ./.envs/.production/.postgres

  traefik:
    build:
      context: .
      dockerfile: ./compose/production/traefik/Dockerfile
    image: fancy_tsunami_production_traefik
    depends_on:
      - django
    volumes:
      - production_traefik:/etc/traefik/acme
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"

  redis:
    image: redis:3.2

  celeryworker:
    <<: *django
    image: fancy_tsunami_production_celeryworker
    command: /start-celeryworker

  celerybeat:
    <<: *django
    image: fancy_tsunami_production_celerybeat
    command: /start-celerybeat

  flower:
    <<: *django
    image: fancy_tsunami_production_flower
    ports:
      - "5555:5555"
    command: /start-flower

0 个答案:

没有答案