Added docker building.

This commit is contained in:
2023-02-20 01:15:47 +00:00
parent 70224f337a
commit 02b5a13902
8 changed files with 64 additions and 36 deletions

View File

@ -1,12 +1,15 @@
FROM rust:1.67.1-alpine3.17 as builder
FROM rust:1.67.1-buster as builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY Cargo.toml Cargo.lock askama.toml ./
COPY src ./src
COPY static ./static
RUN cargo build --release --all-features
FROM debian:bullseye-20230109-slim as base
WORKDIR /
RUN apt-get update \
&& apt-get install -y openssl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
@ -21,4 +24,5 @@ FROM base as rootless
RUN useradd --create-home -u 1000 --user-group s3bot
WORKDIR /home/s3bot
RUN mv /static ./static
USER s3bot