new backup sw
This commit is contained in:
parent
7f38106002
commit
b3840c5037
6 changed files with 86 additions and 37 deletions
|
@ -1,39 +1,18 @@
|
|||
FROM alpine:latest
|
||||
FROM rust AS builder
|
||||
|
||||
MAINTAINER Didier <dev@faulty.nl>
|
||||
LABEL Description="Faulty's (totally original) backup app"
|
||||
|
||||
# Add a non root user
|
||||
RUN adduser -s /bin/sh -D backups
|
||||
RUN addgroup containers
|
||||
RUN addgroup backups containers
|
||||
|
||||
# python
|
||||
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
|
||||
|
||||
# directories
|
||||
RUN mkdir /app
|
||||
RUN mkdir /config
|
||||
RUN mkdir /data
|
||||
RUN mkdir /remote
|
||||
RUN mkdir /local
|
||||
|
||||
# chown
|
||||
RUN chown -R backups:containers /app
|
||||
RUN chown -R backups:containers /config
|
||||
RUN chown -R backups:containers /data
|
||||
RUN chown -R backups:containers /local
|
||||
RUN chown -R backups:containers /remote
|
||||
|
||||
# copy files
|
||||
COPY ./repo/src/main.py /app/main.py
|
||||
COPY ./repo/src/lib /app/lib
|
||||
COPY ./repo/src/sample_configs /app/default_config
|
||||
|
||||
# copy config
|
||||
COPY ./config /config
|
||||
|
||||
USER backups
|
||||
WORKDIR /app
|
||||
ENV PYTHONUNBUFFERED=true
|
||||
ENTRYPOINT python3 main.py
|
||||
|
||||
COPY ./repo /app
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM ubuntu
|
||||
|
||||
COPY --from=builder /app/target/release/bits-backups /app/bits-backups
|
||||
|
||||
COPY ./config/config.toml /app/config.toml
|
||||
|
||||
COPY ./config/tasks/* /app/tasks/
|
||||
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["/app/bits-backups"]
|
||||
|
|
Reference in a new issue