Added docker building.
This commit is contained in:
@ -4,6 +4,7 @@ WORKDIR /app
|
||||
COPY Cargo.toml Cargo.lock askama.toml ./
|
||||
COPY src ./src
|
||||
COPY static ./static
|
||||
# Build binary in release mode.
|
||||
RUN cargo build --release --all-features
|
||||
|
||||
FROM debian:bullseye-20230109-slim as base
|
||||
@ -16,12 +17,16 @@ RUN apt-get update \
|
||||
|
||||
COPY static ./static
|
||||
|
||||
# Copy built binary to a new image.
|
||||
COPY --from=builder /app/target/release/s3bot /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/s3bot"]
|
||||
|
||||
FROM base as rootless
|
||||
|
||||
# Create a user and make the image rootless. So no one
|
||||
# can escalate privileges even if they have access to
|
||||
# container.
|
||||
RUN useradd --create-home -u 1000 --user-group s3bot
|
||||
WORKDIR /home/s3bot
|
||||
RUN mv /static ./static
|
||||
|
Reference in New Issue
Block a user