zed/Dockerfile.migrator

16 lines
512 B
Docker
Raw Normal View History

# syntax = docker/dockerfile:1.2
2022-01-26 23:54:51 +03:00
FROM rust:1.58-bullseye as builder
WORKDIR app
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=./target \
cargo install sqlx-cli --root=/app --target-dir=/app/target --version 0.5.7
FROM debian:bullseye-slim as runtime
RUN apt-get update; \
apt-get install -y --no-install-recommends libssl1.1
WORKDIR app
COPY --from=builder /app/bin/sqlx /app
COPY ./server/migrations /app/migrations
ENTRYPOINT ["/app/sqlx", "migrate", "run"]