blog/backend/Dockerfile
SquidSpirit 1900628a8f BLOG-90 feat: integrate Sentry for error tracking and reporting
- Added `anyhow` and `sentry` dependencies to the backend and feature crates.
- Introduced `SentryConfiguration` to manage Sentry settings.
- Updated error handling in various services to use `anyhow::Error` for unexpected errors.
- Captured errors using Sentry in the web handlers for better observability.
- Removed specific database error handling in favor of a more generic unexpected error handling.
- Configured Sentry in the main application entry point and wrapped the Actix app with Sentry middleware.
2025-08-06 17:25:32 +08:00

34 lines
880 B
Docker

FROM rust:1-slim AS base
RUN apt update -qq && apt install -y -qq --no-install-recommends musl-tools
RUN rustup target add x86_64-unknown-linux-musl
FROM base AS builder
WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl
FROM alpine:latest AS runner
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/server .
EXPOSE 8080
VOLUME ["/app/static"]
ENV RUST_LOG=info
ENV RUST_BACKTRACE=1
ENV HOST=0.0.0.0
ENV PORT=8080
ENV STORAGE_PATH=/app/static
ENV DATABASE_HOST=127.0.0.1
ENV DATABASE_PORT=5432
ENV DATABASE_USER=postgres
ENV DATABASE_PASSWORD=
ENV DATABASE_NAME=postgres
ENV REIDS_URL=redis://127.0.0.1:6379
ENV SESSION_KEY='64-bytes-hex-string-which-can-be-generated-by-`openssl rand -hex 64`'
ENV OIDC_ISSUER_URL=
ENV OIDC_REDIRECT_URL=
ENV OIDC_CLIENT_ID=
ENV OIDC_CLIENT_SECRET=
ENV SENTRY_DSN=
CMD ["./server"]