chore: import upstream snapshot with attribution
CI / compile_and_lint (push) Failing after 0s
CI / docker_build (linux/amd64, -linux-amd64-duckdb, duckdb) (push) Failing after 0s
CI / docker_build (linux/arm64, -linux-arm64, minimal) (push) Failing after 2s
CI / docker_build (linux/arm64, -linux-arm64-duckdb, duckdb) (push) Failing after 1s
CI / docker_build (linux/amd64, minimal) (push) Failing after 1s
CI / test (, sqlite, sqlite::memory:) (push) Has been skipped
CI / test (mssql, mssql, mssql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (mysql, mysql, mysql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (oracle, oracle, Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!) (push) Has been skipped
CI / test (postgres, odbc, Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!, true) (push) Has been skipped
CI / test (postgres, postgres, postgres://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / playwright (push) Has been skipped
CI / docker_build (linux/arm/v7, -linux-arm-v7, minimal) (push) Failing after 0s
CI / hurl_examples (push) Failing after 8s
deploy website / deploy_official_site (push) Failing after 1s
CI / hurl (${{ matrix.example }}) (push) Has been skipped
CI / docker_push (duckdb) (push) Has been cancelled
CI / docker_push (minimal) (push) Has been cancelled
CI / windows_test (push) Has been cancelled
CI / compile_and_lint (push) Failing after 0s
CI / docker_build (linux/amd64, -linux-amd64-duckdb, duckdb) (push) Failing after 0s
CI / docker_build (linux/arm64, -linux-arm64, minimal) (push) Failing after 2s
CI / docker_build (linux/arm64, -linux-arm64-duckdb, duckdb) (push) Failing after 1s
CI / docker_build (linux/amd64, minimal) (push) Failing after 1s
CI / test (, sqlite, sqlite::memory:) (push) Has been skipped
CI / test (mssql, mssql, mssql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (mysql, mysql, mysql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (oracle, oracle, Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!) (push) Has been skipped
CI / test (postgres, odbc, Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!, true) (push) Has been skipped
CI / test (postgres, postgres, postgres://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / playwright (push) Has been skipped
CI / docker_build (linux/arm/v7, -linux-arm-v7, minimal) (push) Failing after 0s
CI / hurl_examples (push) Failing after 8s
deploy website / deploy_official_site (push) Failing after 1s
CI / hurl (${{ matrix.example }}) (push) Has been skipped
CI / docker_push (duckdb) (push) Has been cancelled
CI / docker_push (minimal) (push) Has been cancelled
CI / windows_test (push) Has been cancelled
This commit is contained in:
+71
@@ -0,0 +1,71 @@
|
||||
FROM --platform=$BUILDPLATFORM rust:1.95-slim AS builder
|
||||
|
||||
WORKDIR /usr/src/sqlpage
|
||||
ARG TARGETARCH
|
||||
ARG BUILDARCH
|
||||
ARG CARGO_PROFILE=superoptimized
|
||||
ENV CARGO_PROFILE=$CARGO_PROFILE
|
||||
|
||||
COPY scripts/ /usr/local/bin/
|
||||
RUN cargo init .
|
||||
|
||||
RUN /usr/local/bin/setup-cross-compilation.sh "$TARGETARCH" "$BUILDARCH"
|
||||
|
||||
COPY .cargo/ .cargo/
|
||||
COPY Cargo.toml Cargo.lock build.rs ./
|
||||
COPY sqlpage/ sqlpage/
|
||||
RUN /usr/local/bin/build-dependencies.sh
|
||||
|
||||
COPY . .
|
||||
RUN /usr/local/bin/build-project.sh
|
||||
|
||||
# Default minimal image (busybox-based)
|
||||
FROM busybox:glibc AS minimal
|
||||
RUN addgroup --gid 1000 --system sqlpage && \
|
||||
adduser --uid 1000 --system --no-create-home --ingroup sqlpage sqlpage && \
|
||||
mkdir -p /etc/sqlpage && \
|
||||
touch /etc/sqlpage/sqlpage.db && \
|
||||
chown -R sqlpage:sqlpage /etc/sqlpage/sqlpage.db
|
||||
ENV SQLPAGE_WEB_ROOT=/var/www
|
||||
ENV SQLPAGE_CONFIGURATION_DIRECTORY=/etc/sqlpage
|
||||
WORKDIR /var/www
|
||||
COPY --from=builder /usr/src/sqlpage/sqlpage.bin /usr/local/bin/sqlpage
|
||||
# Provide runtime helper libs in system lib directory for the glibc busybox base
|
||||
COPY --from=builder /tmp/sqlpage-libs/* /lib/
|
||||
USER sqlpage
|
||||
COPY --from=builder --chown=sqlpage:sqlpage /usr/src/sqlpage/sqlpage/sqlpage.db sqlpage/sqlpage.db
|
||||
EXPOSE 8080
|
||||
CMD ["/usr/local/bin/sqlpage"]
|
||||
|
||||
# DuckDB ODBC image (debian-based with DuckDB ODBC driver)
|
||||
FROM debian:trixie-slim AS duckdb
|
||||
|
||||
ARG TARGETARCH
|
||||
ENV SQLPAGE_WEB_ROOT=/var/www
|
||||
ENV SQLPAGE_CONFIGURATION_DIRECTORY=/etc/sqlpage
|
||||
ENV DATABASE_URL="Driver=/opt/duckdb_odbc/libduckdb_odbc.so;Database=/var/lib/sqlpage/duckdb.db"
|
||||
|
||||
COPY scripts/install-duckdb-odbc.sh scripts/setup-sqlpage-user.sh /usr/local/bin/
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
unzip \
|
||||
adduser \
|
||||
odbcinst \
|
||||
unixodbc \
|
||||
&& /usr/local/bin/install-duckdb-odbc.sh "$TARGETARCH" \
|
||||
&& apt-get purge -y --auto-remove curl unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN /usr/local/bin/setup-sqlpage-user.sh
|
||||
|
||||
COPY --from=builder /usr/src/sqlpage/sqlpage.bin /usr/local/bin/sqlpage
|
||||
|
||||
USER sqlpage
|
||||
WORKDIR /var/www
|
||||
EXPOSE 8080
|
||||
CMD ["/usr/local/bin/sqlpage"]
|
||||
|
||||
# Default stage
|
||||
FROM minimal
|
||||
Reference in New Issue
Block a user