Copy over migrations folder into container
All checks were successful
Podman Rootless Demo / test-backend (push) Successful in 9m10s
Podman Rootless Demo / test-frontend (push) Successful in 12s
Podman Rootless Demo / build-backend (push) Successful in 5m21s
Podman Rootless Demo / build-frontend (push) Successful in 2m21s
Podman Rootless Demo / deploy-prod (push) Successful in 36s

This commit is contained in:
continuist 2025-09-21 12:23:50 -04:00
parent 9506b4b09c
commit 1c542bfca7

View file

@ -7,6 +7,7 @@ FROM base AS planner
RUN apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/*
RUN cargo install --locked cargo-chef RUN cargo install --locked cargo-chef
COPY . . COPY . .
COPY migrations /app/migrations
RUN cargo chef prepare --recipe-path recipe.json RUN cargo chef prepare --recipe-path recipe.json
# Deps: compile only external crates # Deps: compile only external crates
@ -24,6 +25,7 @@ COPY --from=deps /usr/local/rustup /usr/local/rustup
# Copy only release artifacts to save space # Copy only release artifacts to save space
COPY --from=deps /app/target/release /app/target/release COPY --from=deps /app/target/release /app/target/release
COPY . . COPY . .
COPY --from=planner /app/migrations /app/migrations
# Clean up incremental compilation artifacts before test build # Clean up incremental compilation artifacts before test build
RUN rm -rf /app/target/debug/incremental RUN rm -rf /app/target/debug/incremental
RUN cargo test --workspace --locked --no-run RUN cargo test --workspace --locked --no-run
@ -37,5 +39,6 @@ COPY --from=test-build /app/target /app/target
COPY --from=test-build /app/Cargo.toml /app/Cargo.toml COPY --from=test-build /app/Cargo.toml /app/Cargo.toml
COPY --from=test-build /app/Cargo.lock /app/Cargo.lock COPY --from=test-build /app/Cargo.lock /app/Cargo.lock
COPY --from=test-build /app/crates /app/crates COPY --from=test-build /app/crates /app/crates
COPY --from=test-build /app/migrations /app/migrations
WORKDIR /app WORKDIR /app
CMD ["cargo", "test", "--workspace", "--locked", "--", "--test-threads=1"] CMD ["cargo", "test", "--workspace", "--locked", "--", "--test-threads=1"]