mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 11:11:24 +01:00
35 lines
1.2 KiB
Docker
35 lines
1.2 KiB
Docker
# Migration container for running Rust-based database migrations
|
|
# Supports both persons and cyclotron migrations
|
|
FROM rust:1.88-bookworm AS builder
|
|
|
|
RUN cargo install sqlx-cli --version 0.8.0 --features postgres --no-default-features --locked
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
ca-certificates=20230311+deb12u1 \
|
|
libpq5=15.14-0+deb12u1 \
|
|
postgresql-client=15+248+deb12u1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /usr/local/cargo/bin/sqlx /usr/local/bin/sqlx
|
|
|
|
WORKDIR /migrations
|
|
|
|
COPY ./persons_migrations ./persons_migrations
|
|
COPY ./cyclotron-core/migrations ./cyclotron-core/migrations
|
|
COPY ./behavioral_cohorts_migrations ./behavioral_cohorts_migrations
|
|
|
|
COPY ./bin/migrate-persons ./bin/migrate-persons
|
|
COPY ./bin/migrate-cyclotron ./bin/migrate-cyclotron
|
|
COPY ./bin/migrate-behavioral-cohorts ./bin/migrate-behavioral-cohorts
|
|
COPY ./bin/migrate-entry ./bin/migrate-entry
|
|
|
|
RUN chmod +x /migrations/bin/migrate-entry && \
|
|
chmod +x /migrations/bin/migrate-persons && \
|
|
chmod +x /migrations/bin/migrate-cyclotron && \
|
|
chmod +x /migrations/bin/migrate-behavioral-cohorts
|
|
|
|
ENTRYPOINT ["/migrations/bin/migrate-entry"]
|