How to configure Azurite Docker Container to Use public URLs for the containing objects?

237 views Asked by At

I'm currently running the Azurite Docker container on my Virtual Machine via docker-compose, and I'm encountering an issue with public URLs for the uploaded files. The public URLs generated by Azurite look like http://azurite:10000/..., which prevents me from accessing these objects externally. Is there a configuration option that allows me to make public URLs start from the VM's IP address?

Here's my docker-compose configuration for reference:

version: "3.2"

services:
    azurite:
        container_name: azurite
        image: mcr.microsoft.com/azure-storage/azurite
        command: "azurite-blob --blobHost 0.0.0.0"
        ports:
            - "10000:10000"

     web-api:
         image: ...
         ports:
             - "8080:80"
         environment:
             - ConnectionStrings__AzuriteConnectionString=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;
         depends_on:
             - azurite
1

There are 1 answers

0
NutellaTN On

It is a best practice to use swarm or kubernetes in this scenario. docker-compose is suitable for running containers in your local machine. Since you're using a remote VM, I think that no doubts you're having such problem.