2024-08-02 14:39:21 +00:00
|
|
|
FROM rust:1.80-alpine3.20 as builder
|
|
|
|
WORKDIR /usr/src/autotasker
|
|
|
|
COPY . .
|
|
|
|
RUN apk add musl-dev
|
|
|
|
RUN cargo install --locked --path .
|
|
|
|
|
|
|
|
FROM alpine:3.20
|
|
|
|
|
2024-08-02 17:40:14 +00:00
|
|
|
RUN apk add sqlite openssh
|
2024-08-02 14:39:21 +00:00
|
|
|
COPY --from=builder /usr/local/cargo/bin/autotasker /usr/local/bin/autotasker
|
|
|
|
RUN mkdir -p /usr/local/src/autotasker/migrations
|
|
|
|
RUN mkdir -p /usr/local/lib/autotasker/assets
|
|
|
|
RUN mkdir -p /var/lib/autotasker
|
|
|
|
RUN mkdir -p /etc/autotasker
|
|
|
|
COPY --from=builder /usr/src/autotasker/migrations/all.sql /usr/local/src/autotasker/migrations
|
|
|
|
COPY --from=builder /usr/src/autotasker/init_db.sh /usr/local/bin/autotasker_init_db.sh
|
|
|
|
COPY --from=builder /usr/src/autotasker/assets /usr/local/lib/autotasker/assets
|
|
|
|
|
|
|
|
ENV RUST_LOG=info
|
|
|
|
ENV RUST_BACKTRACE=1
|
|
|
|
|
|
|
|
CMD ["autotasker", "--listen-host", "127.0.0.1", "--listen-port", "8080"]
|
|
|
|
|