version: '2.2'

services:
  migrate_influx:
    image: influxdb:alpine
    volumes:
      - influx_data:/var/lib/influxdb
      - ../migration:/tmp/migration
    command: sh -c "influxd restore -metadir /var/lib/influxdb/meta /tmp/migration && influxd restore -database stations -datadir /var/lib/influxdb/data /tmp/migration"

  migrate_stations:
    image: alpine:latest
    volumes:
      - ../stations:/tmp/source
      - station_data:/tmp/dest
    working_dir: /tmp/source
    command: sh -c "mv ./* /tmp/dest/"

  web:
    volumes:
      - ./util/fixtures/01_docker_migration.sql:/var/azuracast/www/util/fixtures/01_docker_migration.sql