2026-10-07 13:30:01 +01:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
# Build: docker build -t meguri .
|
|
|
|
|
# Run: docker run -p 3000:3000 \
|
|
|
|
|
# -e DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/meguri \
|
|
|
|
|
# -e MEGURI_PUBLIC_URL=https://meguri.example.internal \
|
|
|
|
|
# -e MEGURI_OIDC_CLIENT_SECRET=... \
|
|
|
|
|
# -v ./instance-config.yaml:/etc/meguri/config.yaml:ro meguri
|
|
|
|
|
# The instance configuration (workspaces, group mappings, sign-in) is mounted, never baked in.
|
|
|
|
|
# See deploy/instance-config.example.yaml and docs/deployment.md.
|
|
|
|
|
|
2026-09-24 14:35:05 +03:00
|
|
|
FROM rust:1.97-bookworm AS build
|
|
|
|
|
WORKDIR /build
|
2026-10-07 13:30:01 +01:00
|
|
|
# Compile dependencies in their own layer so source edits do not rebuild them.
|
2026-09-24 14:35:05 +03:00
|
|
|
COPY Cargo.toml Cargo.lock ./
|
2026-10-07 13:30:01 +01:00
|
|
|
RUN mkdir src && echo 'fn main() {}' > src/main.rs && touch src/lib.rs \
|
|
|
|
|
&& cargo build --locked --release && rm -rf src
|
2026-09-24 14:35:05 +03:00
|
|
|
COPY src ./src
|
|
|
|
|
COPY static ./static
|
2026-10-07 13:30:01 +01:00
|
|
|
RUN touch src/main.rs src/lib.rs && cargo build --locked --release
|
2026-09-24 14:35:05 +03:00
|
|
|
|
|
|
|
|
FROM debian:bookworm-slim
|
2026-10-07 13:30:01 +01:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2026-09-24 14:35:05 +03:00
|
|
|
COPY --from=build /build/target/release/meguri /usr/local/bin/meguri
|
|
|
|
|
COPY static/vendor/ALPINE-LICENSE.md /usr/share/licenses/meguri/alpine-MIT.md
|
2026-10-07 13:30:01 +01:00
|
|
|
COPY static/vendor/cytoscape.LICENSE /usr/share/licenses/meguri/cytoscape-MIT.md
|
2026-09-24 14:35:05 +03:00
|
|
|
USER 65532:65532
|
2026-10-07 13:30:01 +01:00
|
|
|
ENV MEGURI_BIND=0.0.0.0:3000 \
|
|
|
|
|
MEGURI_CONFIG_FILE=/etc/meguri/config.yaml
|
2026-09-24 14:35:05 +03:00
|
|
|
EXPOSE 3000
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/meguri"]
|