Skip to content

Commit 5483cb5

Browse files
Merge pull request #2 from chandanrattan/feat/dora-mvp
latest changes
2 parents d62de02 + 2a0b551 commit 5483cb5

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

backend/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install poetry
6+
RUN pip install poetry
7+
8+
# Copy poetry files
9+
COPY pyproject.toml poetry.lock ./
10+
11+
# Configure poetry to not create a virtual environment
12+
RUN poetry config virtualenvs.create false
13+
14+
# Install dependencies
15+
RUN poetry install --no-dev --no-interaction --no-ansi
16+
17+
# Copy application code
18+
COPY . .
19+
20+
# Expose port
21+
EXPOSE 8000
22+
23+
# Run the application
24+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.8'
2+
3+
services:
4+
backend:
5+
build: ./backend
6+
ports:
7+
- "8000:8000"
8+
environment:
9+
- GITHUB_TOKEN=${GITHUB_TOKEN}
10+
- GITHUB_REPO=${GITHUB_REPO}
11+
12+
frontend:
13+
build:
14+
context: ./frontend
15+
args:
16+
- VITE_API_URL=http://localhost:8000
17+
ports:
18+
- "80:80"
19+
environment:
20+
- VITE_API_URL=http://localhost:8000
21+
depends_on:
22+
- backend

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:18-alpine as build
3+
4+
WORKDIR /app
5+
6+
COPY package*.json ./
7+
RUN npm ci
8+
9+
ARG VITE_API_URL
10+
ENV VITE_API_URL=$VITE_API_URL
11+
12+
COPY . .
13+
RUN npm run build
14+
15+
# Production stage
16+
FROM nginx:alpine
17+
18+
COPY --from=build /app/dist /usr/share/nginx/html
19+
20+
# Copy custom nginx config if needed, or use default for now
21+
# For SPA, we usually need a config to fallback to index.html
22+
RUN echo 'server { \
23+
listen 80; \
24+
location / { \
25+
root /usr/share/nginx/html; \
26+
index index.html index.htm; \
27+
try_files $uri $uri/ /index.html; \
28+
} \
29+
}' > /etc/nginx/conf.d/default.conf
30+
31+
EXPOSE 80
32+
33+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)