ci: add docker support
This commit is contained in:
parent
3384228e61
commit
84a456003c
10 changed files with 189 additions and 112 deletions
24
Dockerfile
Normal file
24
Dockerfile
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
|
||||
RUN apk add sqlite
|
||||
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
|
||||
|
||||
USER 1000
|
||||
ENV RUST_LOG=info
|
||||
ENV RUST_BACKTRACE=1
|
||||
|
||||
CMD ["autotasker", "--listen-host", "127.0.0.1", "--listen-port", "8080"]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue