forked from sqliteai/sqlite-sync
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
47 lines (37 loc) · 1.29 KB
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
40
41
42
43
44
45
46
47
# PostgreSQL Docker image with CloudSync extension pre-installed
FROM postgres:17
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
postgresql-server-dev-17 \
git \
make \
&& rm -rf /var/lib/apt/lists/*
# Create directory for extension source
WORKDIR /tmp/cloudsync
# Copy entire source tree (needed for includes and makefiles)
COPY src/ ./src/
COPY modules/ ./modules/
COPY docker/ ./docker/
COPY Makefile .
# Build and install the CloudSync extension
RUN make postgres-build && \
make postgres-install && \
make postgres-clean
# Verify installation
RUN echo "Verifying CloudSync extension installation..." && \
ls -la $(pg_config --pkglibdir)/cloudsync.so && \
ls -la $(pg_config --sharedir)/extension/cloudsync* && \
echo "CloudSync extension installed successfully"
# Set default PostgreSQL credentials
ENV POSTGRES_PASSWORD=postgres
ENV POSTGRES_DB=cloudsync_test
# Expose PostgreSQL port
EXPOSE 5432
# Copy initialization script (creates CloudSync metadata tables)
COPY docker/postgresql/init.sql /docker-entrypoint-initdb.d/
# Return to root directory
WORKDIR /
# Add label with extension version
LABEL org.sqliteai.cloudsync.version="1.0" \
org.sqliteai.cloudsync.description="PostgreSQL with CloudSync CRDT extension"