version: '2'

services:
  db:
    image: postgres:9.5
    environment:
      POSTGRES_DB: $DB_NAME
      POSTGRES_USER: $DB_USER
      POSTGRES_PASSWORD: $DB_PASS
    volumes:
      - data:/var/lib/postgresql
    ports:
      - "127.0.0.1:5432:5432"
  app:
    image: quay.io/levlaz/braindump:latest
    environment:
      MAIL_USERNAME: $MAIL_USERNAME
      MAIL_PASSWORD: $MAIL_PASSWORD
      BRAINDUMP_ADMIN: $BRAINDUMP_ADMIN
      SECRET_KEY: $SECRET_KEY
      FLASK_CONFIG: $FLASK_CONFIG
      DB_USER: $DB_USER
      DB_PASS: $DB_PASS
      DB_HOST: $DB_HOST
      DB_NAME: $DB_NAME
    ports:
      - "127.0.0.1:8000:8000"
    depends_on:
      - db
    entrypoint: ./scripts/start-app.sh
  web:
    restart: always
    build: ./etc/conf/
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /etc/letsencrypt:/etc/letsencrypt
    links:
      - app:app

volumes:
  data:
version: '2'

services:
  db:
    image: postgres:9.5
    environment:
      POSTGRES_DB: $DB_NAME
      POSTGRES_USER: $DB_USER
      POSTGRES_PASSWORD: $DB_PASS
    volumes:
      - data:/var/lib/postgresql
    ports:
      - "127.0.0.1:5432:5432"
  app:
    image: quay.io/levlaz/braindump:stable
    environment:
      MAIL_USERNAME: $MAIL_USERNAME
      MAIL_PASSWORD: $MAIL_PASSWORD
      BRAINDUMP_ADMIN: $BRAINDUMP_ADMIN
      SECRET_KEY: $SECRET_KEY
      FLASK_CONFIG: $FLASK_CONFIG
      DB_USER: $DB_USER
      DB_PASS: $DB_PASS
      DB_HOST: $DB_HOST
      DB_NAME: $DB_NAME
    ports:
      - "127.0.0.1:8000:8000"
    depends_on:
      - db
    entrypoint: ./scripts/start-app.sh
  web:
    restart: always
    build: ./etc/conf/
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /etc/letsencrypt:/etc/letsencrypt
    links:
      - app:app

volumes:
  data:
Use Stable instead of Latest in Production
Use Stable instead of Latest in Production
