build with postgres support
Diff
Cargo.lock | 11 +++++++++++
Dockerfile | 10 +++++++++-
chartered-db/Cargo.toml | 2 +-
3 files changed, 19 insertions(+), 4 deletions(-)
@@ -394,10 +394,12 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d"
dependencies = [
"bitflags",
"byteorder",
"chrono",
"diesel_derives",
"libsqlite3-sys",
"pq-sys",
"r2d2",
]
@@ -1133,6 +1135,15 @@
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]]
name = "pq-sys"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ac25eee5a0582f45a67e837e350d784e7003bd29a5f460796772061ca49ffda"
dependencies = [
"vcpkg",
]
[[package]]
name = "proc-macro-hack"
@@ -1,16 +1,20 @@
FROM rust:alpine AS builder
RUN apk add --update gcc g++ build-base alpine-sdk sqlite-dev
RUN apk add --update gcc g++ build-base alpine-sdk sqlite-dev openssl-dev postgresql-dev
WORKDIR /app
COPY . /app
RUN cargo build --release
FROM scratch AS chartered-git
FROM alpine AS chartered-git
RUN apk add --update postgresql-dev && \
ln -s /lib/ld-musl-$(uname -m).so.1 /lib/ld-linux-$(uname -m).so.1
WORKDIR /app
COPY --from=builder /app/target/release/chartered-git /app/chartered-git
ENV RUST_LOG=debug
ENTRYPOINT ["/app/chartered-git"]
FROM scratch AS chartered-web
FROM alpine AS chartered-web
RUN apk add --update postgresql-dev && \
ln -s /lib/ld-musl-$(uname -m).so.1 /lib/ld-linux-$(uname -m).so.1
WORKDIR /app
COPY --from=builder /app/target/release/chartered-web /app/chartered-web
ENV RUST_LOG=debug
@@ -12,7 +12,7 @@
base64 = "0.13"
bitflags = "1"
chrono = "0.4"
diesel = { version = "1", features = ["sqlite", "r2d2", "chrono"] }
diesel = { version = "1", features = ["sqlite", "postgres", "r2d2", "chrono"] }
diesel_logger = "0.1"
diesel_migrations = "1.4"
displaydoc = "0.2"