Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Dockerfile.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY src ./src
ENV KINFIN_WORKDIR=/kinfin
ENV KINFIN_PORT=8000
ENV RESULTS_BASE_DIR=/kinfin/output
ENV SESSION_INACTIVITY_THRESHOLD=24
ENV KINFIN_LIMIT_INIT=1/minute
ENV KINFIN_LIMIT_STANDARD=60/minute
ENV KINFIN_LIMIT_LOW=300/minute

CMD ["python", "src/main.py", "serve", "-p", "8000"]
15 changes: 15 additions & 0 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

FROM node:20-alpine AS build

WORKDIR /app
COPY src/ui/package*.json ./
RUN npm install --legacy-peer-deps
COPY src/ui/ ./
RUN npm run build

FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
api:
build:
context: .
dockerfile: Dockerfile.api
container_name: kinfin-api
volumes:
- ./data:/app/data
- /home/dinesh/tmp/kinfin:/kinfin # FIXED path
ports:
- "8000:8000"

ui:
build:
context: .
dockerfile: Dockerfile.ui
container_name: kinfin-ui
ports:
- "5173:80"
depends_on:
- api
10 changes: 10 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 80;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri /index.html;
}
}
2 changes: 1 addition & 1 deletion src/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ def hello():

app.include_router(router)

uvicorn.run(app=app, port=args.port)
uvicorn.run(app=app, host="0.0.0.0", port=args.port)
Loading