Skip to content

Commit 561159b

Browse files
Refactor Dockerfile paths in azure_custom.yaml to simplify structure and ensure correct file references for backend and frontend services.
1 parent 9e53645 commit 561159b

3 files changed

Lines changed: 56 additions & 4 deletions

File tree

azure_custom.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ services:
1616
host: containerapp
1717
language: python
1818
docker:
19-
path: ../../docker/Backend.Dockerfile
20-
context: ../../docker
19+
path: Dockerfile
2120
frontend:
2221
project: ./src/frontend
2322
host: containerapp
2423
language: js
2524
docker:
26-
path: ../../docker/Frontend.Dockerfile
27-
context: ../../docker
25+
path: Dockerfile
2826

2927
infra:
3028
provider: bicep

src/backend/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.11-slim
2+
3+
# This is required by the executable called by the Syntax Checker agent
4+
RUN apt-get update && \
5+
apt-get install -y libicu-dev && \
6+
rm -rf /var/lib/apt/lists/*
7+
8+
WORKDIR /app
9+
10+
# Copy only requirements first to leverage Docker cache
11+
COPY requirements.txt .
12+
13+
# Install dependencies
14+
RUN pip install --no-cache-dir -r requirements.txt
15+
16+
# Copy backend code
17+
COPY . .
18+
19+
EXPOSE 8000
20+
21+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]

src/frontend/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Build stage
2+
FROM node:20 AS build
3+
4+
WORKDIR /app
5+
6+
# Copy package files
7+
COPY package*.json ./
8+
9+
# Install dependencies
10+
RUN npm install
11+
12+
# Copy frontend source
13+
COPY . .
14+
15+
# Build the app
16+
RUN npm run build
17+
18+
# Runtime stage
19+
FROM python:3.11-slim
20+
21+
WORKDIR /app
22+
23+
# Copy Python requirements and install
24+
COPY requirements.txt .
25+
RUN pip install --no-cache-dir -r requirements.txt
26+
27+
# Copy built assets from build stage
28+
COPY --from=build /app/dist ./dist
29+
COPY frontend_server.py .
30+
31+
EXPOSE 3000
32+
33+
CMD ["uvicorn", "frontend_server:app", "--host", "0.0.0.0", "--port", "3000"]

0 commit comments

Comments
 (0)