File size: 815 Bytes
db7efc1
de0fb90
347ba2f
db7efc1
6f5ae02
 
db7efc1
 
d76057f
db7efc1
 
de0fb90
db7efc1
 
de0fb90
db7efc1
de0fb90
 
db7efc1
de0fb90
 
 
 
 
 
 
 
44ad3c5
 
 
db7efc1
44ad3c5
 
 
db7efc1
 
 
d76057f
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
39
# Use Python 3.10 as base image
FROM python:3.10-slim

# Set working directory in container
WORKDIR /app/src

# Copy requirements file
COPY src/requirements.txt .

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire project
COPY src .

# Expose ports for API and Streamlit
EXPOSE 8000 8501

# Create script to run both services
RUN echo '#!/bin/bash\n\
python response_api.py &\n\
sleep 5\n\
streamlit run app.py' > ./start.sh

# Make the script executable
RUN chmod +x ./start.sh

# Create necessary directories and set permissions
RUN mkdir -p /app/src/.embedchain && chmod -R 777 /app/src/.embedchain

# Copy .env file and set environment variables
COPY src/.env .

# Set environment variables from .env
ENV $(cat .env | xargs)

# Run the start script
CMD ["./start.sh"]