2021-02-09 11:44:33 +01:00
|
|
|
FROM rust:alpine as build
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
ENV RUSTFLAGS='-C target-feature=-crt-static'
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
WORKDIR /app
|
|
|
|
COPY ./site .
|
|
|
|
RUN apk add --no-cache musl-dev sqlite-dev
|
2021-02-13 14:04:38 +01:00
|
|
|
RUN cargo install --path . -j $(nproc)
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
FROM alpine:latest
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
COPY --from=build /usr/local/cargo/bin/crablog /app/crablog
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache libgcc sqlite-libs
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
ENV ROOT_PATH=/app/content
|
|
|
|
ENV DATABASE_URL=${ROOT_PATH}/db.sqlite3
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
EXPOSE 8000
|
2020-11-17 18:01:54 +01:00
|
|
|
|
2021-02-09 11:44:33 +01:00
|
|
|
CMD ["./crablog"]
|