Skip to content

Commit

Permalink
[DOCKER]
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 23, 2024
1 parent f9d970c commit a40ee2c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the official Python 3.12 image
FROM python:3.12-slim
FROM python:3.12-slim AS base

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
Expand All @@ -9,6 +9,7 @@ ENV PYTHONUNBUFFERED=1
WORKDIR /app

# Install system dependencies for faster builds
FROM base AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
Expand All @@ -23,6 +24,8 @@ RUN pip install --upgrade pip && \
pip install -r requirements.txt

# Copy the application code
FROM base
COPY --from=builder /app /app
COPY . .

# Command to run the application with dynamic worker count
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.8'

services:
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=1
- WORKSPACE_DIR=agent_workspace
- OPENAI_API_KEY=${OPENAI_API_KEY}
- GROQ_API_KEY=${GROQ_API_KEY}
volumes:
- .:/app

0 comments on commit a40ee2c

Please sign in to comment.