Skip to content

Commit a385c2e

Browse files
committed
deployment docker changes
1 parent 50a1ea6 commit a385c2e

13 files changed

Lines changed: 43 additions & 254 deletions

__azurite_db_queue__.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"filename":"c:\\src\\Multi-Agent-Custom-Automation-Engine-Solution-Accelerator\\__azurite_db_queue__.json","collections":[{"name":"$SERVICES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{},"constraints":null,"uniqueNames":["accountName"],"transforms":{},"objType":"$SERVICES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$QUEUES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"name":{"name":"name","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$QUEUES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$MESSAGES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"queueName":{"name":"queueName","dirty":false,"values":[]},"messageId":{"name":"messageId","dirty":false,"values":[]},"visibleTime":{"name":"visibleTime","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$MESSAGES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}

__azurite_db_queue_extent__.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"filename":"c:\\src\\Multi-Agent-Custom-Automation-Engine-Solution-Accelerator\\__azurite_db_queue_extent__.json","collections":[{"name":"$EXTENTS_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"id":{"name":"id","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$EXTENTS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}

docker/Backend.Dockerfile

Lines changed: 0 additions & 54 deletions
This file was deleted.

docker/Backend_s.Dockerfile

Lines changed: 0 additions & 31 deletions
This file was deleted.

docker/Frontend copy.Dockerfile

Lines changed: 0 additions & 64 deletions
This file was deleted.

docker/Frontend.Dockerfile

Lines changed: 0 additions & 64 deletions
This file was deleted.

docker/docker-compose.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

infra/main.bicep

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ param containerAppConfiguration containerAppConfigurationType = {
194194
containerMemory: '4.0Gi'
195195
containerImageRegistryDomain: 'biabcontainerreg.azurecr.io'
196196
containerImageName: 'macaebackend'
197-
containerImageTag: 'latest'
197+
containerImageTag: 'dev01'
198198
containerName: 'backend'
199199
ingressTargetPort: 8000
200200
maxReplicas: 1
@@ -218,7 +218,7 @@ param webSiteConfiguration webSiteConfigurationType = {
218218
location: solutionLocation
219219
containerImageRegistryDomain: 'biabcontainerreg.azurecr.io'
220220
containerImageName: 'macaefrontend'
221-
containerImageTag: 'latest'
221+
containerImageTag: 'dev01'
222222
containerName: 'backend'
223223
tags: tags
224224
environmentResourceId: null //Default value set on module configuration
@@ -1132,7 +1132,7 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
11321132
containers: [
11331133
{
11341134
name: containerAppConfiguration.?containerName ?? 'backend'
1135-
image: '${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'latest'}'
1135+
image: '${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'dev01'}'
11361136
resources: {
11371137
//TODO: Make cpu and memory parameterized
11381138
cpu: containerAppConfiguration.?containerCpu ?? '2.0'
@@ -1240,7 +1240,7 @@ module webSite 'br/public:avm/res/web/site:0.15.1' = if (webSiteEnabled) {
12401240
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceId }]
12411241
publicNetworkAccess: 'Enabled' //TODO: use Azure Front Door WAF or Application Gateway WAF instead
12421242
siteConfig: {
1243-
linuxFxVersion: 'DOCKER|${webSiteConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${webSiteConfiguration.?containerImageName ?? 'macaefrontend'}:${webSiteConfiguration.?containerImageTag ?? 'latest'}'
1243+
linuxFxVersion: 'DOCKER|${webSiteConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${webSiteConfiguration.?containerImageName ?? 'macaefrontend'}:${webSiteConfiguration.?containerImageTag ?? 'dev01'}'
12441244
}
12451245
appSettingsKeyValuePairs: {
12461246
SCM_DO_BUILD_DURING_DEPLOYMENT: 'true'

src/frontend_react/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ FROM node:18-alpine AS frontend-builder
66
WORKDIR /app/frontend
77

88
# Copy package files first for better caching
9-
COPY src/frontend_react/package*.json ./
9+
COPY package*.json ./
1010

1111
# Install dependencies
1212
RUN npm ci --silent
1313

1414
# Copy source files
15-
COPY src/frontend_react/ ./
15+
COPY . ./
1616

1717
# Build the React app
1818
RUN npm run build
@@ -29,20 +29,29 @@ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
2929
WORKDIR /app
3030

3131
# Copy Python project definition files
32-
COPY src/frontend_react/pyproject.toml src/frontend_react/uv.lock* ./
32+
COPY pyproject.toml uv.lock* ./
3333

3434
# Install Python dependencies using UV
3535
RUN --mount=type=cache,target=/root/.cache/uv \
36-
uv pip install --system -r <(uv pip freeze --requirement pyproject.toml)
36+
if [ -f "requirements.txt" ]; then \
37+
uv pip install --system -r requirements.txt && uv pip install --system "uvicorn[standard]"; \
38+
else \
39+
uv pip install --system pyproject.toml && uv pip install --system "uvicorn[standard]"; \
40+
fi
3741

3842
# Stage 3: Final production image
3943
FROM python:3.11-slim-bullseye
4044

4145
# Set production environment
4246
ENV NODE_ENV=production \
4347
PYTHONDONTWRITEBYTECODE=1 \
44-
PYTHONUNBUFFERED=1 \
45-
PATH="/app/venv/bin:$PATH"
48+
PYTHONUNBUFFERED=1
49+
50+
# Install curl for healthcheck
51+
RUN apt-get update && \
52+
apt-get install -y --no-install-recommends curl && \
53+
apt-get clean && \
54+
rm -rf /var/lib/apt/lists/*
4655

4756
WORKDIR /app
4857

@@ -59,7 +68,7 @@ COPY --from=python-builder /usr/local/bin /usr/local/bin
5968
COPY --from=frontend-builder --chown=appuser:appuser /app/frontend/build /app/static
6069

6170
# Copy Python application code
62-
COPY --chown=appuser:appuser src/frontend_react/*.py /app/
71+
COPY --chown=appuser:appuser ./*.py /app/
6372

6473
# Create log directory with correct permissions
6574
RUN mkdir -p /app/logs && chown -R appuser:appuser /app/logs
@@ -74,5 +83,7 @@ EXPOSE 3000
7483
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
7584
CMD curl -f http://localhost:3000/health || exit 1
7685

86+
RUN touch "log_config.json"
87+
7788
# Run the application with uvicorn
78-
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "3000", "--log-config", "log_config.json"]
89+
CMD ["/usr/local/bin/uvicorn", "frontend_server:app", "--host", "0.0.0.0", "--port", "3000", "--log-config", "log_config.json"]

0 commit comments

Comments
 (0)