Docker modified for deployment
This commit is contained in:
parent
e4e6781a63
commit
c0acdb9e94
13
Dockerfile
13
Dockerfile
@ -3,9 +3,11 @@ FROM python:3.9-slim
|
|||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV GROQ_API_KEY "add your GROQ API key here"
|
ENV GROQ_API_KEY "add your GROQ API key here"
|
||||||
|
# ENV VIRTUAL_ENV=/opt/venv
|
||||||
|
# ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
|
||||||
# Set work directory
|
# Set work directory
|
||||||
WORKDIR ./
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
@ -13,17 +15,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
python3-dev \
|
python3-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Create and activate virtual environment
|
||||||
|
# RUN python -m venv $VIRTUAL_ENV
|
||||||
|
|
||||||
# Copy requirements file
|
# Copy requirements file
|
||||||
COPY ./requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Copy project
|
# Copy project
|
||||||
COPY ./ /app
|
COPY . .
|
||||||
|
|
||||||
# Expose the port the app runs on
|
# Expose the port the app runs on
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Command to run the application
|
# Command to run the application
|
||||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
Loading…
x
Reference in New Issue
Block a user