Skip to content

Commit

Permalink
dockerFile update
Browse files Browse the repository at this point in the history
  • Loading branch information
astorfi committed Nov 23, 2024
1 parent b063fa2 commit ac15cab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand All @@ -25,9 +26,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker Image Locally
- name: Build Docker Image with System Dependencies
run: |
docker build -t local-llm-alignment-template:latest -f deployment/Dockerfile .
docker build --build-arg PIP_UPGRADE=true -t local-llm-alignment-template:latest -f deployment/Dockerfile .
- name: Run Docker Container Locally
run: |
Expand Down
23 changes: 19 additions & 4 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
FROM python:3.8-slim
FROM python:3.9-slim

# Define arguments that can be used during the build
ARG PIP_UPGRADE

WORKDIR /app

# Copy only production requirements
# Install system-level dependencies that are commonly needed
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
curl \
libxml2-dev \
libxslt-dev \
&& rm -rf /var/lib/apt/lists/*

# Upgrade pip if specified
RUN if [ "$PIP_UPGRADE" = "true" ]; then pip install --upgrade pip; fi

# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire application code to the working directory
COPY . .

# Run the FastAPI app using Uvicorn
CMD ["uvicorn", "src.deployment.fastapi_app:app", "--host", "0.0.0.0", "--port", "8000"]
# Set up the command to run the FastAPI server
CMD ["uvicorn", "src.deployment.model_container:app", "--host", "0.0.0.0", "--port", "8000"]

0 comments on commit ac15cab

Please sign in to comment.