# Follow guide at https://realpython.com/blog/python/dockerizing-flask-with-compose-and-machine-from-localhost-to-the-cloud/

version: '3.3'

services:
  web:
    build: .
    ports:
      - 5000:5000
    command: gunicorn -b 0.0.0.0:5000 ocspdash.web.wsgi:app --log-level=DEBUG
    depends_on:
     - db
    environment:
      OCSPDASH_CONNECTION: postgresql://postgres:postgres@db:5432/postgres
      SECRET_KEY: ${SECRET_KEY}
      CENSYS_API_ID: ${CENSYS_API_ID}
      CENSYS_API_SECRET: ${CENSYS_API_SECRET}
    restart: on-failure

  db:
    image: postgres:latest
    volumes:
      - db_data:/var/lib/postgres

volumes:
  db_data:

# Follow guide at https://realpython.com/blog/python/dockerizing-flask-with-compose-and-machine-from-localhost-to-the-cloud/

version: '3.3'

services:
  web:
    build: .
    ports:
      - 5000:5000
    command: gunicorn -b 0.0.0.0:5000 ocspdash.web.wsgi:app --log-level=DEBUG
    depends_on:
     - db
    environment:
      OCSPDASH_CONNECTION: postgresql://postgres:postgres@db:5432/postgres
      SECRET_KEY: ${SECRET_KEY}
      CENSYS_API_ID: ${CENSYS_API_ID}
      CENSYS_API_SECRET: ${CENSYS_API_SECRET}
    restart: on-failure

  db:
    image: postgres:latest
    volumes:
      - type: bind
        source: ./db_data
        target: /var/lib/postgres

Move Postgres data into a bind volume.
Move Postgres data into a bind volume.

Maybe it'll actually persist this time?
