File size: 954 Bytes
f48a9aa
2636575
1051b46
 
2636575
f48a9aa
2636575
1051b46
f48a9aa
2636575
849b2fa
 
f48a9aa
 
2636575
4df7c12
849b2fa
f48a9aa
 
 
 
4df7c12
f48a9aa
 
 
 
12a9bf1
25f4c40
 
 
 
 
 
81ec8d6
 
 
2dbc823
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.11 as build

# Set the working directory to /app
WORKDIR /app

ENV PYTHONPATH=/app

# Install any needed packages specified in requirements.txt
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install poetry

RUN poetry config virtualenvs.create false

COPY ./pyproject.toml ./poetry.lock* /app/
RUN poetry install

# Download the 'stopwords' resource before running the app
RUN python -c "import nltk; nltk.download('stopwords')"
# RUN chmod -R 775 /usr/local/lib/python3.11/site-packages/llama_index

# ====================================
FROM build as release

COPY . .

# Make port 8000 available to the world outside this container
EXPOSE 8000

ENV POSTGRES_USER codepath_project_owner
ENV POSTGRES_PASSWORD 03EdiworgCJz
ENV POSTGRES_DB_NAME codepath_project
ENV POSTGRES_DB_HOST ep-icy-cloud-a5m4mcgo.us-east-2.aws.neon.tech
ENV POSTGRES_DB_PORT 5432

# Run migrations
RUN alembic upgrade head

CMD ["python", "main.py"]