2018-10-08 19:36:07 +04:00
|
|
|
FROM clux/muslrust:nightly as builder
|
2018-10-07 16:16:08 +04:00
|
|
|
|
2018-12-12 06:43:06 +04:00
|
|
|
RUN cargo install diesel_cli --no-default-features --features postgres
|
|
|
|
RUN mkdir -p /out && cp /root/.cargo/bin/diesel /out/
|
2018-10-07 16:16:08 +04:00
|
|
|
|
2018-12-12 06:43:06 +04:00
|
|
|
COPY . /app
|
2018-10-07 16:16:08 +04:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN cargo build --release
|
|
|
|
|
2018-12-06 10:39:17 +04:00
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
COPY --from=builder /out/diesel /bin/
|
2018-10-08 19:36:07 +04:00
|
|
|
|
|
|
|
COPY --from=builder /app/migrations /application/migrations
|
|
|
|
COPY --from=builder /app/Rocket.toml /application/Rocket.toml
|
2018-10-09 19:52:06 +04:00
|
|
|
COPY --from=builder /app/Cargo.toml /application/Cargo.toml
|
2018-10-08 19:36:07 +04:00
|
|
|
COPY --from=builder /app/entrypoint.sh /application/entrypoint.sh
|
2018-10-09 10:00:14 +04:00
|
|
|
COPY --from=builder /app/static /application/static
|
2018-10-08 19:36:07 +04:00
|
|
|
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/rubble /application/rubble
|
|
|
|
|
|
|
|
EXPOSE 8000
|
2018-10-09 09:58:47 +04:00
|
|
|
|
|
|
|
ENV ROCKET_ENV production
|
2018-10-23 10:03:06 +04:00
|
|
|
ENV ROCKET_SECRET_KEY 123456
|
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
|
|
|
|
CMD ["sh", "./entrypoint.sh"]
|