- Create scripts/init-db.sql for DB schema initialization - Enhance start-services.sh to auto-initialize DB if needed - Fix users admin handler: change root route from '/users' to '/' to avoid double prefix - Remove deprecated handlers (departments/designations/employees) from users service - Add missing admin route mappings for users and approval/case endpoints in gateway - Update gateway to correctly handle /api/admin/users, /api/admin/approvals, etc. - Update .env.example and docs These changes enable running the stack without Docker and fix admin panel routing.
41 lines
878 B
Docker
41 lines
878 B
Docker
# Build stage
|
|
FROM rust:1.79-slim AS builder
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
# Install build dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
pkg-config \
|
|
libsqlite3-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy manifests
|
|
COPY Cargo.toml ./
|
|
COPY crates ./crates
|
|
COPY apps ./apps
|
|
|
|
# Build the application (release mode for smaller binary)
|
|
RUN cargo build --release --bin ugc_content_creators
|
|
|
|
# Runtime stage
|
|
FROM debian:bookworm-slim AS runtime
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
libsqlite3-0 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create app user
|
|
RUN useradd -m -u 1000 appuser
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /usr/src/app/target/release/ugc_content_creators ./ugc_content_creators
|
|
|
|
# Switch to non-root user
|
|
USER appuser
|
|
|
|
# Run the binary
|
|
CMD ["./ugc_content_creators"]
|