Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ htmlcov/
*.temp
.cache/


# Architecture
ARCHITECTURE.md
36 changes: 36 additions & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
venv/
env/
ENV/
.venv

# Testing
.pytest_cache/
.coverage
htmlcov/
*.log

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Project specific
*.md
.git/
.gitignore
tests/
pytest.ini
pyproject.toml
Comment thread
martian56 marked this conversation as resolved.

18 changes: 18 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.12-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*

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

COPY . .

Comment thread
martian56 marked this conversation as resolved.
EXPOSE 8000

Comment thread
martian56 marked this conversation as resolved.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Comment thread
martian56 marked this conversation as resolved.

Comment thread
martian56 marked this conversation as resolved.
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
services:
api:
build:
context: ./api
dockerfile: Dockerfile
container_name: chatops-api
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://user:password@db:5432/chatops
- SECRET_KEY=your-secret-key-change-in-production
Comment thread
martian56 marked this conversation as resolved.
- CORS_ORIGINS=http://localhost:5173,http://localhost:3000
Comment thread
martian56 marked this conversation as resolved.
Outdated
depends_on:
- db
Comment thread
martian56 marked this conversation as resolved.
volumes:
- ./api/.env:/app/.env # Mount .env file if it exists
restart: unless-stopped

db:
image: postgres:16-alpine
container_name: chatops-db
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
Comment thread
martian56 marked this conversation as resolved.
- POSTGRES_DB=chatops
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped

volumes:
postgres_data: