services:

  openscad-preview:
    build:
      context: ../../
      dockerfile: ./src/docker/openscad/Dockerfile
    image: openscad
    command: js/openscad.preview
    # Adding volumes so that the containers can be restarted for js only changes in local dev
    volumes:
      - ../../dist/docker/openscad:/var/task/js/
      - ../../dist/docker/common:/var/task/common/
    ports:
      - "5052:8080"
    environment:
      AWS_SECRET_ACCESS_KEY: "${DEV_AWS_SECRET_ACCESS_KEY}"
      AWS_ACCESS_KEY_ID: "${DEV_AWS_ACCESS_KEY_ID}"
      BUCKET: "${DEV_BUCKET}"

  openscad-stl:
    image: openscad
    volumes:
      - ../../dist/docker/openscad:/var/task/js/
      - ../../dist/docker/common:/var/task/common/
    command: js/openscad.stl
    ports:
      - "5053:8080"
    environment:
      AWS_SECRET_ACCESS_KEY: "${DEV_AWS_SECRET_ACCESS_KEY}"
      AWS_ACCESS_KEY_ID: "${DEV_AWS_ACCESS_KEY_ID}"
      BUCKET: "${DEV_BUCKET}"

  cadquery-stl:
    build:
      context: ../../
      dockerfile: ./src/docker/cadquery/Dockerfile
    volumes:
      - ../../dist/docker/cadquery:/var/task/js/
      - ../../dist/docker/common:/var/task/common/
    command: js/cadquery.stl
    ports:
      - 5060:8080
    environment:
      AWS_SECRET_ACCESS_KEY: "${DEV_AWS_SECRET_ACCESS_KEY}"
      AWS_ACCESS_KEY_ID: "${DEV_AWS_ACCESS_KEY_ID}"
      BUCKET: "${DEV_BUCKET}"

