| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- # Multi-stage Dockerfile for Spry Framework Demo Website
- # Build stage: Compile the Vala application
- FROM fedora:43 AS builder
- # Install build dependencies
- RUN dnf install -y \
- meson \
- ninja-build \
- gcc \
- vala \
- glib2-devel \
- gobject-introspection-devel \
- json-glib-devel \
- libxml2-devel \
- zlib-devel \
- libzstd-devel \
- libgee-devel \
- brotli-devel \
- libmicrohttpd-devel \
- libsodium-devel \
- git \
- pkg-config \
- && dnf clean all
- # Clone and build invercargill library
- WORKDIR /build
- RUN git clone -b expressions https://fabrica.unitatem.net/Tilo15/Invercargill.git invercargill && \
- cd invercargill && \
- meson setup src builddir --prefix=/usr && \
- ninja -C builddir && \
- ninja -C builddir install && echo hi
- # Clone and build invercargill-json library
- RUN git clone https://git.sr.ht/~tilo15/Invercargill-Json invercargill-json && \
- cd invercargill-json && \
- meson setup src builddir --prefix=/usr && \
- ninja -C builddir && \
- ninja -C builddir install
- # Clone and build inversion library (depends on invercargill)
- RUN git clone https://fabrica.unitatem.net/Tilo15/inversion.git inversion && \
- cd inversion && \
- meson setup builddir --prefix=/usr && \
- ninja -C builddir && \
- ninja -C builddir install
- # Clone and build astralis library (depends on invercargill, invercargill-json, inversion)
- RUN git clone https://fabrica.unitatem.net/Tilo15/astralis.git astralis && \
- cd astralis && \
- meson setup builddir --prefix=/usr && \
- ninja -C builddir && \
- ninja -C builddir install
- # Copy the Spry project source
- COPY . /build/spry
- # Build the Spry library and demo
- WORKDIR /build/spry
- RUN meson setup builddir --prefix=/usr && \
- ninja -C builddir && \
- ninja -C builddir install
- # Runtime stage: Minimal image with only necessary runtime libraries
- FROM fedora:43 AS runtime
- # Install runtime dependencies only
- RUN dnf install -y \
- glib2 \
- json-glib \
- libxml2 \
- zlib \
- libzstd \
- brotli \
- libmicrohttpd \
- libgee \
- libsodium \
- && dnf clean all
- # Copy built libraries and executable from builder
- COPY --from=builder /usr/lib64/libinvercargill*.so* /usr/lib64/
- COPY --from=builder /usr/lib64/libinvercargill-json*.so* /usr/lib64/
- COPY --from=builder /usr/lib64/libinversion*.so* /usr/lib64/
- COPY --from=builder /usr/lib64/libastralis*.so* /usr/lib64/
- COPY --from=builder /usr/lib64/libspry*.so* /usr/lib64/
- COPY --from=builder /usr/lib64/girepository-1.0/*.typelib /usr/lib64/girepository-1.0/
- COPY --from=builder /usr/bin/spry-demo /usr/bin/
- # Copy demo source files for DemoHostComponent to display in the demo viewer
- # These paths must match what DemoHostComponent.source_file expects
- COPY --from=builder /build/spry/demo/DemoComponents /app/demo/DemoComponents
- # Set working directory so relative paths in DemoHostComponent resolve correctly
- WORKDIR /app
- # Update library cache
- RUN ldconfig
- # Expose the default port
- EXPOSE 8080
- # Set environment variables
- ENV PORT=8080
- # Run the demo website
- CMD ["spry-demo", "8080"]
|