nostrpgx / Dockerfile
a year ago
Chris Daley
25ba7715

Dockerfile

1
# Use the official PostgreSQL image from the Docker Hub
2
FROM postgres:latest
3

4
# Install necessary build tools and dependencies
5
RUN apt-get update && \
6
    apt-get install -y \
7
    build-essential \
8
    postgresql-server-dev-all \
9
    cmake \
10
    git \
11
    curl
12

13
# Install vcpkg for managing dependencies
14
RUN git clone https://github.com/Microsoft/vcpkg.git /vcpkg && \
15
    /vcpkg/bootstrap-vcpkg.sh && \
16
    /vcpkg/vcpkg integrate install && \
17
    /vcpkg/vcpkg install json-c
18

19
# Set environment variables for vcpkg
20
ENV VCPKG_ROOT=/vcpkg
21
ENV VCPKG_TRIPLET=x64-linux
22
ENV VCPKG_INSTALLED=$VCPKG_ROOT/installed/$VCPKG_TRIPLET
23

24
# Copy the extension source code to the container
25
COPY . /usr/src/nostrpgx
26
WORKDIR /usr/src/nostrpgx
27

28
# Build the extension
29
RUN make
30

31
# Add the extension to the PostgreSQL configuration
32
RUN echo "shared_preload_libraries = 'nostrpgx'" >> /usr/share/postgresql/postgresql.conf.sample
33

34
# Expose the default PostgreSQL port
35
EXPOSE 5432
36

37
# Start PostgreSQL server
38
CMD ["postgres"]
39

gitworkshop.dev logo GitWorkshop.dev