Add DuckDB to the Docker build and the Gem
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -14,10 +14,25 @@ FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
|
||||
# Rails app lives here
|
||||
WORKDIR /rails
|
||||
|
||||
# Install base packages
|
||||
# Install base packages and DuckDB library
|
||||
ARG TARGETPLATFORM
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \
|
||||
apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 wget unzip && \
|
||||
ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \
|
||||
case "$TARGETPLATFORM" in \
|
||||
"linux/amd64") \
|
||||
DUCKDB_ARCH="amd64" ;; \
|
||||
"linux/arm64") \
|
||||
DUCKDB_ARCH="arm64" ;; \
|
||||
*) \
|
||||
echo "Unsupported platform: $TARGETPLATFORM" && exit 1 ;; \
|
||||
esac && \
|
||||
wget "https://install.duckdb.org/v1.4.2/libduckdb-linux-${DUCKDB_ARCH}.zip" -O /tmp/libduckdb.zip && \
|
||||
unzip /tmp/libduckdb.zip -d /tmp/duckdb && \
|
||||
cp /tmp/duckdb/duckdb.h /tmp/duckdb/duckdb.hpp /usr/local/include/ && \
|
||||
cp /tmp/duckdb/libduckdb.so /usr/local/lib/ && \
|
||||
ldconfig && \
|
||||
rm -rf /tmp/libduckdb.zip /tmp/duckdb && \
|
||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
||||
|
||||
# Set production environment variables and enable jemalloc for reduced memory usage and latency.
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -94,3 +94,5 @@ end
|
||||
gem "sentry-rails", "~> 6.1"
|
||||
|
||||
gem "postgresql_cursor", "~> 0.6.9"
|
||||
|
||||
gem "duckdb", "~> 1.4"
|
||||
|
||||
@@ -116,6 +116,8 @@ GEM
|
||||
device_detector (1.1.3)
|
||||
dotenv (3.1.8)
|
||||
drb (2.2.3)
|
||||
duckdb (1.4.1.1)
|
||||
bigdecimal (>= 3.1.4)
|
||||
ed25519 (1.4.0)
|
||||
email_validator (2.2.4)
|
||||
activemodel
|
||||
@@ -488,6 +490,7 @@ DEPENDENCIES
|
||||
countries
|
||||
debug
|
||||
device_detector
|
||||
duckdb (~> 1.4)
|
||||
httparty
|
||||
image_processing (~> 1.2)
|
||||
importmap-rails
|
||||
|
||||
Reference in New Issue
Block a user