This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,17 @@ services:
4949 networks :
5050 - backend
5151
52+ azurite-setup :
53+ container_name : azurite-setup
54+ build :
55+ context : ./
56+ dockerfile : ./setup/azurite/Dockerfile
57+ network_mode : host
58+ depends_on :
59+ - azurite
60+ environment :
61+ - AZURITE_CONNECTION_STRING=${AZURITE_CONNECTION_STRING}
62+
5263 db :
5364 container_name : " db"
5465 image : mcr.microsoft.com/mssql/server:2022-latest
Original file line number Diff line number Diff line change 1+ FROM python:3.13-slim
2+
3+ COPY ./setup/azurite .
4+ RUN pip install --no-cache-dir azure-storage-blob==12.22.0 && pip install azure-storage-queue
5+ CMD ["python3" , "-u" , "./azurite-setup.py" ]
Original file line number Diff line number Diff line change 1+ import os
2+ from azure .storage .blob import BlobServiceClient
3+ from azure .storage .queue import QueueServiceClient
4+ from azure .core .exceptions import ResourceExistsError
5+
6+ def setup_azurite ():
7+ connection_string = os .getenv ("AZURITE_CONNECTION_STRING" )
8+
9+ blob_service_client = BlobServiceClient .from_connection_string (connection_string )
10+ queue_service_client = QueueServiceClient .from_connection_string (connection_string )
11+ print ("Connected to Azurite" )
12+
13+ try :
14+ blob_service_client .create_container ("blob-data-service" )
15+ queue_service_client .create_queue ("queue1" )
16+ print ("Queues & blob containers created" )
17+ except ResourceExistsError :
18+ print ("Queues & blob containers already exist" )
19+
20+ setup_azurite ()
You can’t perform that action at this time.
0 commit comments