@@ -57,7 +57,7 @@ RUN set -eux; \
|
|||||||
esac; \
|
esac; \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
# Install curl, Python, and PostgreSQL client libraries
|
# Install curl, Python, and PostgreSQL client libraries
|
||||||
apt-get install -y curl python3 python3-venv libpq-dev && \
|
apt-get install -y curl python3 python3-venv libpq-dev redis-server && \
|
||||||
# Install Node.js
|
# Install Node.js
|
||||||
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
|
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
|
||||||
apt-get install -y nodejs && \
|
apt-get install -y nodejs && \
|
||||||
@@ -95,7 +95,7 @@ COPY --from=builder /app .
|
|||||||
# Copy initialization SQL if it exists
|
# Copy initialization SQL if it exists
|
||||||
COPY init.sql /docker-entrypoint-initdb.d/
|
COPY init.sql /docker-entrypoint-initdb.d/
|
||||||
|
|
||||||
EXPOSE 8283 5432 4317 4318
|
EXPOSE 8283 5432 6379 4317 4318
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
CMD ["./letta/server/startup.sh"]
|
CMD ["./letta/server/startup.sh"]
|
||||||
|
|||||||
@@ -12,6 +12,29 @@ wait_for_postgres() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to wait for Redis to be ready
|
||||||
|
wait_for_redis() {
|
||||||
|
until redis-cli ping 2>/dev/null | grep -q PONG; do
|
||||||
|
echo "Waiting for Redis to be ready..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if we're configured for external Redis
|
||||||
|
if [ -n "$LETTA_REDIS_HOST" ]; then
|
||||||
|
echo "External Redis configuration detected, using env var LETTA_REDIS_HOST=$LETTA_REDIS_HOST"
|
||||||
|
else
|
||||||
|
echo "No external Redis configuration detected, starting internal Redis..."
|
||||||
|
redis-server --daemonize yes --bind 0.0.0.0
|
||||||
|
|
||||||
|
# Wait for Redis to be ready
|
||||||
|
wait_for_redis
|
||||||
|
|
||||||
|
# Set default Redis host for internal redis
|
||||||
|
export LETTA_REDIS_HOST="localhost"
|
||||||
|
echo "Using internal Redis at: $LETTA_REDIS_HOST"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if we're configured for external Postgres
|
# Check if we're configured for external Postgres
|
||||||
if [ -n "$LETTA_PG_URI" ]; then
|
if [ -n "$LETTA_PG_URI" ]; then
|
||||||
echo "External Postgres configuration detected, using env var LETTA_PG_URI"
|
echo "External Postgres configuration detected, using env var LETTA_PG_URI"
|
||||||
|
|||||||
Reference in New Issue
Block a user