version: "3"
services:
  mongodb:
    image: mongo:latest
    volumes:
      - mongodb:/data/db
    networks:
      - common
  mysql:
    image: mariadb
    depends_on:
      - mongodb
    environment:
      - MYSQL_ROOT_PASSWORD=Wichtig1
      - MYSQL_DATABASE=psc
    volumes:
      - mysql:/var/lib/mysql
    networks:
      - common
  cron:
    image: registry.thomas-peterson.de/printshopcreator/docker/php-cron-prod:2.2
    depends_on:
      - mongodb
      - mysql
    environment:
      - SYMFONY_DECRYPTION_SECRET=ZfzbggHk012ImxwsovgF0iLkJf7pUJlMJ+uBLNTHFxbwz0iwe7STUJhAyULlDSv9unBVXfPW3DFf/VuVw6vPCQ==%
    volumes:
      - templates:/data/www/old/application/design
      - styles:/data/www/old/public/styles
      - temp:/data/www/old/public/temp
      - market:/data/www/old/market
      - market:/data/www/new/web/market
      - temp:/data/www/new/web/uploads_backend
      - temp:/data/www/new/web/temp
      - uploads:/data/www/new/web/uploads
      - uploads:/data/www/old/public/uploads
      - shops:/data/www/old/public/shops
      - shops:/data/www/new/web/uploads_shops
      - packages:/data/www/old/data/packages
      - media:/data/www/new/web/media
      - bundles:/data/www/new/web/bundles
      - plugins:/data/www/new/var/plugins/Custom
    networks:
      - common
  php-fpm:
    image: registry.thomas-peterson.de/printshopcreator/docker/php-fpm-prod:2.2
    depends_on:
      - mongodb
      - mysql
    environment:
      - ftpUsername=benutzername
      - ftpPassword=123456
      - ftpHost=x.x.x.x
      - ftpPort=20000
      - ftpIp=x.x.x.x
      - SYMFONY_DECRYPTION_SECRET=ZfzbggHk012ImxwsovgF0iLkJf7pUJlMJ+uBLNTHFxbwz0iwe7STUJhAyULlDSv9unBVXfPW3DFf/VuVw6vPCQ==%
    volumes:
      - templates:/data/www/old/application/design
      - styles:/data/www/old/public/styles
      - temp:/data/www/old/public/temp
      - market:/data/www/old/market
      - market:/data/www/new/web/market
      - temp:/data/www/new/web/uploads_backend
      - temp:/data/www/new/web/temp
      - uploads:/data/www/new/web/uploads
      - uploads:/data/www/old/public/uploads
      - shops:/data/www/old/public/shops
      - shops:/data/www/new/web/uploads_shops
      - bundles:/data/www/new/web/bundles
      - packages:/data/www/old/data/packages
      - media:/data/www/new/web/media
      - plugins:/data/www/new/var/plugins/Custom
      - /data/volumes/psc/watch:/data/www/new/watch
      - /data/composer/psc/docker-compose.yml:/data/www/new/compose.yml
    networks:
      - common
  web:
    image: registry.thomas-peterson.de/printshopcreator/docker/web-prod:2.2
    environment:
      - VIRTUAL_HOST=subdomain.domain.de
      - VIRTUAL_PORT=80
      - VIRTUAL_NETWORK=nginx-proxy
      - LETSENCRYPT_HOST=subdomain.domain.de
      - LETSENCRYPT_EMAIL=info@domain.de
    depends_on:
      - mongodb
      - mysql
      - php
    volumes:
      - templates:/data/www/old/application/design
      - styles:/data/www/old/public/styles
      - temp:/data/www/old/public/temp
      - market:/data/www/old/market
      - market:/data/www/new/web/market
      - temp:/data/www/new/web/uploads_backend
      - temp:/data/www/new/web/temp
      - uploads:/data/www/new/web/uploads
      - uploads:/data/www/old/public/uploads
      - shops:/data/www/old/public/shops
      - shops:/data/www/new/web/uploads_shops
      - packages:/data/www/old/data/packages
      - media:/data/www/new/web/media
      - plugins:/data/www/new/var/plugins/Custom
      - bundles:/data/www/new/web/bundles
    ports:
      - "8000:80"
    networks:
      - proxy-tier
      - common
  sftp:
    image: atmoz/sftp
    ports:
        - "20000:22"
    command: ["/entrypoint", "benutzername:123456:::upload"]
    volumes:
      - templates:/home/benutzername/upload/templates
      - uploads:/home/benutzername/upload/uploads
      - packages:/home/benutzername/upload/packages
      - shops:/home/benutzername/upload/shops
      - styles:/home/benutzername/upload/styles
      - temp:/home/benutzername/upload/temp
      - market:/home/benutzername/upload/market
      - plugins:/home/benutzername/upload/plugins
    networks:
      - common
volumes:
  templates:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/templates'
  styles:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/styles'
  shops:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/shops'
  packages:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/packages'
  plugins:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/plugins'
  uploads:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/uploads'
  temp:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/temp'
  market:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/market'
  media:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/media'
  mysql:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/mysql'
  mongodb:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/data/volumes/psc/mongodb'

networks:
  common:
  proxy-tier:
    external:
      name: nginx-proxy
