Skip to content

Commit

Permalink
Merge pull request #74 from Shaunwei/pcui/add-postgres
Browse files Browse the repository at this point in the history
Add postgres support
  • Loading branch information
pycui authored Jul 16, 2023
2 parents a4c8abf + dc16c80 commit 99148f0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ COPY ./ /realtime_ai_character
# Install Python dependencies
RUN pip install -r requirements.txt

# Build the application
RUN alembic upgrade head

EXPOSE 8000

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

# Run the application
CMD ["uvicorn", "realtime_ai_character.main:app", "--host", "0.0.0.0"]
CMD ["/bin/sh", "/realtime_ai_character/entrypoint.sh"]
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -e
alembic upgrade head
uvicorn realtime_ai_character.main:app --host 0.0.0.0
5 changes: 4 additions & 1 deletion realtime_ai_character/database/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL")

connect_args = {"check_same_thread": False} if SQLALCHEMY_DATABASE_URL.startswith(
"sqlite") else {}

engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
SQLALCHEMY_DATABASE_URL, connect_args=connect_args
)

SessionLocal = sessionmaker(
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ soundfile
click
google-cloud-speech
anthropic
psycopg2-binary

0 comments on commit 99148f0

Please sign in to comment.