db / Dockerfile
TahaRasouli's picture
Update Dockerfile
25c1e96 verified
raw
history blame contribute delete
838 Bytes
# Use the pgvector base image
FROM phidata/pgvector:16
# Set environment variables for PostgreSQL
ENV POSTGRES_DB=ai
ENV POSTGRES_USER=ai
ENV POSTGRES_PASSWORD=ai
ENV PGDATA=/var/lib/postgresql/data/pgdata
# Create volume
VOLUME /var/lib/postgresql/data
# Install Python and create virtual environment
RUN apt-get update && apt-get install -y python3 python3-venv
RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy the application files
COPY ./requirements.txt requirements.txt
COPY ./app.py app.py
COPY ./assistant.py assistant.py
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Expose the application port
EXPOSE 7860
# Command to run PostgreSQL and the application
CMD ["sh", "-c", "postgres & uvicorn app:app --host 0.0.0.0 --port 7860"]