# Copy this file to another location and modify as necessary.
version: "3"
services:
  minio:
    image: minio/minio:latest
    ports:
      - "9000:9000"
    volumes:
      - miniodata:/data
    environment:
      # force using given key-secret instead of creating at start
      - MINIO_ACCESS_KEY=${AWS_ACCESS_KEY_ID}
      - MINIO_SECRET_KEY=${AWS_SECRET_ACCESS_KEY}
    command: ["server", "/data"]
  app:
    image: jasonwhite0/rudolfs:latest
    #    build:
    #      context: .
    #      dockerfile: Dockerfile
    ports:
      - "8081:8080"
    volumes:
      - data:/data
    restart: always
    environment:
      - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
      - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
      - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
      - LFS_ENCRYPTION_KEY=${LFS_ENCRYPTION_KEY}
      - LFS_S3_BUCKET=${LFS_S3_BUCKET}
      - LFS_MAX_CACHE_SIZE=${LFS_MAX_CACHE_SIZE}
      - AWS_S3_ENDPOINT=http://minio:9000
    entrypoint:
      - /tini
      - --
      - /rudolfs
      - --cache-dir
      - /data
      - --key
      - ${LFS_ENCRYPTION_KEY}
      - --s3-bucket
      - ${LFS_S3_BUCKET}
      - --max-cache-size
      - ${LFS_MAX_CACHE_SIZE}
    links:
      - minio
  # A real production server should use nginx. How to configure this depends on
  # your needs. Use your Google-search skills to configure this correctly.
  #
  # nginx:
  #   image: nginx:stable
  #   ports:
  #     - 80:80
  #     - 443:443
  #   volumes:
  #     - ./nginx.conf:/etc/nginx/nginx.conf
  #     - ./nginx/errors.log:/etc/nginx/errors.log

volumes:
  data:
  miniodata: