2019-04-19 13:06:30 +04:00
|
|
|
FROM clux/muslrust:stable as builder
|
2018-10-07 16:16:08 +04:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2019-04-20 14:28:38 +04:00
|
|
|
RUN USER=root cargo new rubble
|
|
|
|
WORKDIR /app/rubble
|
|
|
|
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
|
|
|
|
RUN echo 'fn main() { println!("Dummy") }' > ./src/main.rs
|
|
|
|
|
2018-10-07 16:16:08 +04:00
|
|
|
RUN cargo build --release
|
|
|
|
|
2019-04-20 14:28:38 +04:00
|
|
|
RUN rm -r target/x86_64-unknown-linux-musl/release/.fingerprint/rubble-*
|
|
|
|
|
|
|
|
COPY src src/
|
|
|
|
COPY migrations migrations/
|
|
|
|
COPY templates templates/
|
|
|
|
|
|
|
|
RUN cargo build --release --frozen --bin rubble
|
|
|
|
|
|
|
|
|
2018-12-06 10:39:17 +04:00
|
|
|
FROM alpine:latest
|
|
|
|
|
2019-04-20 14:28:38 +04:00
|
|
|
COPY --from=builder /app/rubble/migrations /application/migrations
|
|
|
|
COPY --from=builder /app/rubble/templates /application/templates
|
|
|
|
COPY --from=builder /app/rubble/target/x86_64-unknown-linux-musl/release/rubble /application/rubble
|
2018-10-08 19:36:07 +04:00
|
|
|
|
|
|
|
EXPOSE 8000
|
2018-10-09 09:58:47 +04:00
|
|
|
|
|
|
|
ENV DATABASE_URL postgres://root@postgres/rubble
|
|
|
|
|
2018-10-08 19:36:07 +04:00
|
|
|
WORKDIR /application
|
2019-04-19 13:06:30 +04:00
|
|
|
CMD ["./rubble"]
|